Skip to content
Snippets Groups Projects
Commit 93f4f04b authored by rswindell's avatar rswindell
Browse files

Work-around observed infinite loop trying to print a 0-byte file where

feof() was returning 0 and fgets() never returned NULL. Weird.
parent 8a3d8d2c
No related branches found
No related tags found
No related merge requests found
......@@ -96,10 +96,13 @@ bool sbbs_t::printfile(const char* fname, long mode, long org_cols)
}
length=(long)filelength(file);
if(length<0) {
if(length < 1) {
fclose(stream);
errormsg(WHERE,ERR_CHK,fpath,length);
return false;
if(length < 0) {
errormsg(WHERE,ERR_CHK,fpath,length);
return false;
}
return true;
}
if(mode&P_OPENCLOSE) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment