forked from teamnwah/openmw-tes3coop
fixed getString function in NIF loader
This commit is contained in:
parent
9201baebf9
commit
d684b3ae11
1 changed files with 5 additions and 4 deletions
|
@ -193,11 +193,12 @@ public:
|
|||
|
||||
std::string getString(size_t length)
|
||||
{
|
||||
std::string str;
|
||||
str.resize(length);
|
||||
std::vector<char> str (length+1, 0);
|
||||
|
||||
if(inp->read(&str[0], length) != length)
|
||||
return std::string();
|
||||
return str.substr(0, str.find('\0'));
|
||||
throw std::runtime_error ("string length in NIF file does not match");
|
||||
|
||||
return &str[0];
|
||||
}
|
||||
std::string getString()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue