diff options
author | Filippos Karapetis | 2012-01-15 21:02:02 +0200 |
---|---|---|
committer | Filippos Karapetis | 2012-01-15 21:02:02 +0200 |
commit | aff92ea4cd0db8c9beacebe60c9a7c598b1eb01d (patch) | |
tree | 6ee60a836ff8f91c836260343964ec1efbe43a59 | |
parent | 96aa86a60b036041446ff52975472ae23887a85f (diff) | |
download | scummvm-rg350-aff92ea4cd0db8c9beacebe60c9a7c598b1eb01d.tar.gz scummvm-rg350-aff92ea4cd0db8c9beacebe60c9a7c598b1eb01d.tar.bz2 scummvm-rg350-aff92ea4cd0db8c9beacebe60c9a7c598b1eb01d.zip |
SCI: Zero-terminate strings in SciString::fromString()
-rw-r--r-- | engines/sci/engine/segment.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp index 73d81baf3a..fcf9774a08 100644 --- a/engines/sci/engine/segment.cpp +++ b/engines/sci/engine/segment.cpp @@ -294,11 +294,12 @@ void SciString::fromString(const Common::String &string) { if (_type != 3) error("SciString::fromString(): Array is not a string"); - if (string.size() > _size) - setSize(string.size()); + setSize(string.size() + 1); for (uint32 i = 0; i < string.size(); i++) _data[i] = string[i]; + + _data[string.size()] = 0; } SegmentRef StringTable::dereference(reg_t pointer) { |