mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-04-15 06:31:28 +00:00
Fix weird printing to console that sometimes happened with listImages
It sometimes happened when changing image_* cvars for compression and then vid_restarting and then running listImages. In one case the whole process hung and len was a ridiculously big number => most probably the (unsigned!) size_t overflowed by subtracting a number > len (most likely from input_field.GetCursor()). So I just made it a plain signed int. I couldn't reproduce the issue anymore after doing this change.
This commit is contained in:
parent
b050991ed2
commit
f3cd3f31d0
1 changed files with 3 additions and 1 deletions
|
@ -828,7 +828,9 @@ void tty_Show() {
|
|||
input_hide--;
|
||||
if ( input_hide == 0 ) {
|
||||
char *buf = input_field.GetBuffer();
|
||||
size_t len = strlen(buf);
|
||||
// DG: it happened (not sure how) that len became very big,
|
||||
// most likely because of an overflow (underflow?) so I made it signed
|
||||
int len = strlen(buf);
|
||||
if ( len < 1 )
|
||||
return;
|
||||
|
||||
|
|
Loading…
Reference in a new issue