Keep only one '\0' in NIF strings (bug #6473)

switch-to-ppa
Alexei Dobrohotov 3 years ago
parent c5e10dfa85
commit dd15b30a27

@ -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

@ -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

Loading…
Cancel
Save