Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit bf297492 authored by rswindell's avatar rswindell

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)
break;
buf[length] = 0;
if((mode&P_UTF8) && !term_supports(UTF8))
utf8_normalize_str(buf);
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