diff options
author | Einar Johan Trøan Sømåen | 2016-10-07 00:18:15 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2016-10-07 00:19:58 +0200 |
commit | 1eca88cb398c52fc62424708b8d99ac28ab65433 (patch) | |
tree | f406fbf4677cbfd10cef1a3579874660486f62d8 /engines/wintermute | |
parent | b2dcd1bb1ef920e7723501c9500a8ef0348be03a (diff) | |
download | scummvm-rg350-1eca88cb398c52fc62424708b8d99ac28ab65433.tar.gz scummvm-rg350-1eca88cb398c52fc62424708b8d99ac28ab65433.tar.bz2 scummvm-rg350-1eca88cb398c52fc62424708b8d99ac28ab65433.zip |
WINTERMUTE: Don't crop UIEdit strings to negative sizes
If _maxLength was -1, we would end up with a 0-size allocation,
and a write that starts right before it, which gives odd results.
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/ui/ui_edit.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp index ffe8d66b4d..81030e09c3 100644 --- a/engines/wintermute/ui/ui_edit.cpp +++ b/engines/wintermute/ui/ui_edit.cpp @@ -899,7 +899,7 @@ int UIEdit::deleteChars(int start, int end) { ////////////////////////////////////////////////////////////////////////// int UIEdit::insertChars(int pos, const byte *chars, int num) { - if ((int)strlen(_text) + num > _maxLength) { + if ((_maxLength != -1) && (int)strlen(_text) + num > _maxLength) { num -= (strlen(_text) + num - _maxLength); } |