diff --git a/docs/notework.txt b/docs/notework.txt index d98612c..74b148d 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Win32: prevent video buffer overflow. + - Fixed thread list when replylinkfloat is on (incorrect name position). - Now exists all variants of the AREAFILE token in config examples. diff --git a/goldlib/gall/gvidbase.cpp b/goldlib/gall/gvidbase.cpp index 293c1b9..b4da147 100644 --- a/goldlib/gall/gvidbase.cpp +++ b/goldlib/gall/gvidbase.cpp @@ -844,7 +844,7 @@ void vputs(int row, int col, int atr, const char* str) { int i; - for(i = 0; *str; i++) + for(i = 0; *str && (i < gvid->numcols); i++) gvid->bufwrd[i] = vcatch(*str++, atr); if(i) vputws(row, col, gvid->bufwrd, i); @@ -945,6 +945,9 @@ void vputns(int row, int col, int atr, const char* str, uint width) { int i; + if (width > gvid->numcols) + width = gvid->numcols; + for(i = 0; (i < width) and *str; i++) gvid->bufwrd[i] = vcatch(*str++, atr); vatch filler = vcatch(fillchar, atr); @@ -1035,6 +1038,9 @@ void vputx(int row, int col, int atr, vchar chr, uint len) { #elif defined(__WIN32__) + if (len > gvid->numcols) + len = gvid->numcols; + vatch filler = vcatch(chr, atr); for(int i = 0; i < len; i++) gvid->bufwrd[i] = filler;