Skip to content

Commit f3cd3f3

Browse files
committed
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.
1 parent b050991 commit f3cd3f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

neo/sys/posix/posix_main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,9 @@ void tty_Show() {
828828
input_hide--;
829829
if ( input_hide == 0 ) {
830830
char *buf = input_field.GetBuffer();
831-
size_t len = strlen(buf);
831+
// DG: it happened (not sure how) that len became very big,
832+
// most likely because of an overflow (underflow?) so I made it signed
833+
int len = strlen(buf);
832834
if ( len < 1 )
833835
return;
834836

0 commit comments

Comments
 (0)