Bugfix: XML reader no longer drops last character in strings after certain character replacments

Due an off-by-one error it went wrong where there a special character replacement for the second-last character going on.
So something like "&lt;X" became "<" instead of "<X".

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6295 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2022-01-11 14:45:08 +00:00
parent 31f5da289f
commit 62cf8296b1
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
--------------------------
Changes in 1.9 (not yet released)
- Bugfix: XML reader dropped last character in strings if there was a special character replacement for the second-last character.
- Avoid allocating more than 16k on stack in OCT loader. Also avoid potential heap overwrites in there.
- obj file loader now allows using mtl files with spaces in the filename.
Note that this means it no longer handles obj files which have multiple mtl files behind the mtllib command.

View File

@ -549,7 +549,7 @@ private:
pos = origstr.findNext(L'&', pos);
}
if (oldPos < (int)origstr.size()-1)
if (oldPos < (int)origstr.size())
newstr.append(origstr.subString(oldPos, origstr.size()-oldPos));
return newstr;