--- sbbs/src/sbbs3/prntfile.cpp 2018/04/24 16:41:23 1.1.1.1 +++ sbbs/src/sbbs3/prntfile.cpp 2018/04/24 16:42:33 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet file print/display routines */ -/* $Id: prntfile.cpp,v 1.1.1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: prntfile.cpp,v 1.1.1.2 2018/04/24 16:42:33 root Exp $ */ /**************************************************************************** * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2010 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -78,15 +78,16 @@ void sbbs_t::printfile(char *str, long m if(!(mode&P_NOCRLF) && !tos && !wip && !rip && !html) CRLF; - if((stream=fnopen(&file,str,O_RDONLY))==NULL) { - lprintf(LOG_NOTICE,"Node %d !File not found: %s",cfg.node_num,str); + if((stream=fnopen(&file,str,O_RDONLY|O_DENYNONE))==NULL) { + lprintf(LOG_NOTICE,"Node %d !Error %d (%s) opening: %s" + ,cfg.node_num,errno,strerror(errno),str); bputs(text[FileNotFound]); if(SYSOP) bputs(str); CRLF; return; } - length=filelength(file); + length=(long)filelength(file); if(length<0) { close(file); errormsg(WHERE,ERR_CHK,str,length); @@ -133,14 +134,15 @@ void sbbs_t::printtail(char *str, int li if(!tos) { CRLF; } - if((file=nopen(str,O_RDONLY))==-1) { - lprintf(LOG_NOTICE,"Node %d !File not found: %s",cfg.node_num,str); + if((file=nopen(str,O_RDONLY|O_DENYNONE))==-1) { + lprintf(LOG_NOTICE,"Node %d !Error %d (%s) opening: %s" + ,cfg.node_num,errno,strerror(errno),str); bputs(text[FileNotFound]); if(SYSOP) bputs(str); CRLF; return; } - length=filelength(file); + length=(long)filelength(file); if(length<0) { close(file); errormsg(WHERE,ERR_CHK,str,length);