Commit bf297492 authored by rswindell's avatar rswindell
Browse files

Fix off-by-two issue with fgets() calls in printfile() line-at-a-time mode

(new). Reported by Alterego (ALTERANT)
parent c65542f8
......@@ -128,9 +128,8 @@ bool sbbs_t::printfile(const char* fname, long mode, long org_cols)
return false;
while(!feof(stream) && !msgabort()) {
if(fgets(buf, length-1, stream) == NULL)
if(fgets(buf, length + 1, stream) == NULL)
buf[length] = 0;
if((mode&P_UTF8) && !term_supports(UTF8))
putmsg(buf, mode, org_cols);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment