Commits (1)
...@@ -1278,7 +1278,7 @@ bool sbbs_t::editfile(char *fname, bool msg) ...@@ -1278,7 +1278,7 @@ bool sbbs_t::editfile(char *fname, bool msg)
} }
if((file=nopen(fname,O_RDONLY))!=-1) { if((file=nopen(fname,O_RDONLY))!=-1) {
length=(long)filelength(file); length=(long)filelength(file);
if(length>(long)maxlines*MAX_LINE_LEN) { if(length < 0 || length>(long)maxlines*MAX_LINE_LEN) {
close(file); close(file);
free(buf); free(buf);
attr(cfg.color[clr_err]); attr(cfg.color[clr_err]);
......