diff options
-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) { |