diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d85fbc865..65caa921a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -87,6 +87,7 @@ Bug #6429: Wyrmhaven: Can't add AI packages to player Bug #6433: Items bound to Quick Keys sometimes do not appear until the Quick Key menu is opened Bug #6451: Weapon summoned from Cast When Used item will have the name "None" + Bug #6473: Strings from NIF should be parsed only to first null terminator Feature #890: OpenMW-CS: Column filtering Feature #1465: "Reset" argument for AI functions Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record diff --git a/components/nif/nifstream.hpp b/components/nif/nifstream.hpp index b6bf01ce58..04243c2506 100644 --- a/components/nif/nifstream.hpp +++ b/components/nif/nifstream.hpp @@ -149,6 +149,9 @@ public: inp->read(str.data(), length); if (inp->bad()) throw std::runtime_error("Failed to read sized string of " + std::to_string(length) + " chars"); + size_t end = str.find('\0'); + if (end != std::string::npos) + str.erase(end); return str; } ///Read in a string of the length specified in the file