Commits (3)
/* getnode.cpp */
/* Synchronet node information retrieval functions */
/* $Id: getnode.cpp,v 1.56 2020/08/01 22:04:03 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
......@@ -17,21 +13,9 @@
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
......@@ -257,7 +241,7 @@ int sbbs_t::getnmsg(bool clearline)
return(errno);
}
length=(long)filelength(file);
if(!length) {
if(length <= 0) {
close(file);
return(0);
}
......
......@@ -173,7 +173,7 @@ js_send(JSContext *cx, uintN argc, jsval *arglist)
rc=JS_SUSPENDREQUEST(cx);
if(cp && comWriteBuf(p->com,(uint8_t *)cp,len)==len) {
dbprintf(FALSE, p, "sent %u bytes",len);
dbprintf(FALSE, p, "sent %lu bytes",len);
JS_SET_RVAL(cx, arglist, JSVAL_TRUE);
} else {
p->last_error=COM_ERROR_VALUE;
......@@ -241,11 +241,11 @@ js_sendfile(JSContext *cx, uintN argc, jsval *arglist)
close(file);
if(comWriteBuf(p->com,(uint8_t *)buf,(size_t)len)==len) {
dbprintf(FALSE, p, "sent %u bytes",len);
dbprintf(FALSE, p, "sent %ld bytes",len);
JS_SET_RVAL(cx, arglist, JSVAL_TRUE);
} else {
p->last_error=COM_ERROR_VALUE;
dbprintf(TRUE, p, "send of %u bytes failed",len);
dbprintf(TRUE, p, "send of %ld bytes failed",len);
}
free(buf);
......
......@@ -457,7 +457,7 @@ void sbbs_t::read_sif_dat(char *siffile, char *datfile)
return;
}
length=(long)filelength(file);
if(!length) {
if(length <= 0) {
close(file);
return;
}
......