mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 05:00:06 -05:00
--Bug fixes
-Attempt to fix a null termination bug when reading Xml strings.
This commit is contained in:
parent
960f0e11be
commit
47808b567d
@ -336,7 +336,7 @@ static bool ReadFile(const char* filename, string& buf, bool nullTerminate = tru
|
||||
ifs.seekg(0, ios::beg);
|
||||
ifs.read(&buf[0], pos);
|
||||
|
||||
if (nullTerminate)//Optionally NULL terminate if they want to treat it as a string.
|
||||
if (nullTerminate && (buf[buf.size() - 1] != 0))//Optionally NULL terminate if they want to treat it as a string, and it's not terminated arleady.
|
||||
buf[buf.size() - 1] = 0;
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user