[Scummvm-git-logs] scummvm master -> 1eca88cb398c52fc62424708b8d99ac28ab65433

somaen einarjohants at gmail.com
Fri Oct 7 00:20:13 CEST 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1eca88cb39 WINTERMUTE: Don't crop UIEdit strings to negative sizes


Commit: 1eca88cb398c52fc62424708b8d99ac28ab65433
    https://github.com/scummvm/scummvm/commit/1eca88cb398c52fc62424708b8d99ac28ab65433
Author: Einar Johan Trøan Sømåen (einarjohants at gmail.com)
Date: 2016-10-07T00:19:58+02:00

Commit Message:
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.

Changed paths:
    engines/wintermute/ui/ui_edit.cpp



diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp
index ffe8d66..81030e0 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);
 	}
 





More information about the Scummvm-git-logs mailing list