--- sbbs/src/sbbs3/rechocfg.c 2018/04/24 16:41:23 1.1.1.1 +++ sbbs/src/sbbs3/rechocfg.c 2018/04/24 16:42:55 1.1.1.2 @@ -2,13 +2,13 @@ /* Synchronet FidoNet EchoMail Scanning/Tossing and NetMail Tossing Utility */ -/* $Id: rechocfg.c,v 1.1.1.1 2018/04/24 16:41:23 root Exp $ */ +/* $Id: rechocfg.c,v 1.1.1.2 2018/04/24 16:42:55 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 2000 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2011 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 * @@ -196,6 +196,7 @@ void read_echo_cfg() cfg.maxbdlsize=DFLT_BDL_SIZE; cfg.badecho=-1; cfg.log=LOG_DEFAULTS; + cfg.log_level=LOG_INFO; cfg.check_path=TRUE; while(1) { @@ -222,7 +223,7 @@ void read_echo_cfg() printf("\nError allocating %u bytes of memory for arcdef #%u.\n" ,sizeof(arcdef_t)*(cfg.arcdefs+1),cfg.arcdefs+1); bail(1); } - sprintf(cfg.arcdef[cfg.arcdefs].name,"%-.25s",p); + SAFECOPY(cfg.arcdef[cfg.arcdefs].name,p); tp=cfg.arcdef[cfg.arcdefs].name; while(*tp && *tp>' ') tp++; *tp=0; @@ -231,7 +232,7 @@ void read_echo_cfg() cfg.arcdef[cfg.arcdefs].byteloc=atoi(p); while(*p && *p>' ') p++; while(*p && *p<=' ') p++; - sprintf(cfg.arcdef[cfg.arcdefs].hexid,"%-.25s",p); + SAFECOPY(cfg.arcdef[cfg.arcdefs].hexid,p); tp=cfg.arcdef[cfg.arcdefs].hexid; while(*tp && *tp>' ') tp++; *tp=0; @@ -241,13 +242,13 @@ void read_echo_cfg() if(!strnicmp(p,"PACK ",5)) { p+=5; while(*p && *p<=' ') p++; - sprintf(cfg.arcdef[cfg.arcdefs].pack,"%-.80s",p); + SAFECOPY(cfg.arcdef[cfg.arcdefs].pack,p); truncsp(cfg.arcdef[cfg.arcdefs].pack); continue; } if(!strnicmp(p,"UNPACK ",7)) { p+=7; while(*p && *p<=' ') p++; - sprintf(cfg.arcdef[cfg.arcdefs].unpack,"%-.80s",p); + SAFECOPY(cfg.arcdef[cfg.arcdefs].unpack,p); truncsp(cfg.arcdef[cfg.arcdefs].unpack); } } ++cfg.arcdefs; continue; } @@ -276,6 +277,10 @@ void read_echo_cfg() cfg.log=strtol(cleanstr(p),0,16); continue; } + if(!stricmp(tmp,"LOG_LEVEL")) { + cfg.log_level=atoi(cleanstr(p)); + continue; } + if(!stricmp(tmp,"NOSWAP")) { continue; } @@ -287,6 +292,11 @@ void read_echo_cfg() misc|=STRIP_LF; continue; } + if(!stricmp(tmp,"CONVERT_TEAR")) { + misc|=CONVERT_TEAR; + continue; + } + if(!stricmp(tmp,"STORE_SEENBY")) { misc|=STORE_SEENBY; continue; } @@ -320,25 +330,25 @@ void read_echo_cfg() continue; } if(!stricmp(tmp,"AREAFILE")) { - sprintf(cfg.areafile,"%-.80s",cleanstr(p)); + SAFECOPY(cfg.areafile,cleanstr(p)); continue; } if(!stricmp(tmp,"LOGFILE")) { - sprintf(cfg.logfile,"%-.80s",cleanstr(p)); + SAFECOPY(cfg.logfile,cleanstr(p)); continue; } if(!stricmp(tmp,"INBOUND")) { /* Inbound directory */ - sprintf(cfg.inbound,"%-.80s",cleanstr(p)); + SAFECOPY(cfg.inbound,cleanstr(p)); backslash(cfg.inbound); continue; } if(!stricmp(tmp,"SECURE_INBOUND")) { /* Secure Inbound directory */ - sprintf(cfg.secure,"%-.80s",cleanstr(p)); + SAFECOPY(cfg.secure,cleanstr(p)); backslash(cfg.secure); continue; } if(!stricmp(tmp,"OUTBOUND")) { /* Outbound directory */ - sprintf(cfg.outbound,"%-.80s",cleanstr(p)); + SAFECOPY(cfg.outbound,cleanstr(p)); backslash(cfg.outbound); continue; } @@ -353,7 +363,7 @@ void read_echo_cfg() if(!stricmp(tmp,"USEPACKER")) { /* Which packer to use */ if(!*p) continue; - strcpy(str,p); + SAFECOPY(str,p); p=str; while(*p && *p>' ') p++; if(!*p) @@ -400,12 +410,12 @@ void read_echo_cfg() bail(1); } memset(&cfg.nodecfg[j],0,sizeof(nodecfg_t)); cfg.nodecfg[j].faddr=addr; } - sprintf(cfg.nodecfg[j].pktpwd,"%.8s",p); } + SAFECOPY(cfg.nodecfg[j].pktpwd,p); } if(!stricmp(tmp,"PKTTYPE")) { /* Packet Type to Use */ if(!*p) continue; - strcpy(str,p); + SAFECOPY(str,p); p=str; while(*p && *p>' ') p++; *p=0; @@ -526,7 +536,7 @@ void read_echo_cfg() while(*p && *p>' ') p++; /* Find end of password */ *p=0; /* and terminate the string */ ++p; - sprintf(cfg.nodecfg[i].password,"%-.25s",tp); + SAFECOPY(cfg.nodecfg[i].password,tp); while(*p && *p<=' ') p++; /* Search for more chars */ if(!*p) /* Nothing else there */ continue; @@ -547,7 +557,7 @@ void read_echo_cfg() "flag #%u.\n",cfg.nodecfgs,j+1); bail(1); } cfg.nodecfg[i].numflags++; - sprintf(cfg.nodecfg[i].flag[j].flag,"%.4s",tp); } + SAFECOPY(cfg.nodecfg[i].flag[j].flag,tp); } while(*p && *p<=' ') p++; } } if(!stricmp(tmp,"ECHOLIST")) { /* Echolists go here */ @@ -584,7 +594,7 @@ void read_echo_cfg() *p=0; p++; - sprintf(cfg.listcfg[cfg.listcfgs-1].listpath,"%-.128s",tp); + SAFECOPY(cfg.listcfg[cfg.listcfgs-1].listpath,tp); cfg.listcfg[cfg.listcfgs-1].numflags=0; cfg.listcfg[cfg.listcfgs-1].flag=NULL; while(*p && *p<=' ') p++; /* Skip over whitespace chars */ @@ -605,7 +615,7 @@ void read_echo_cfg() "flag #%u.\n",cfg.listcfgs,j+1); bail(1); } cfg.listcfg[cfg.listcfgs-1].numflags++; - sprintf(cfg.listcfg[cfg.listcfgs-1].flag[j].flag,"%.4s",tp); } + SAFECOPY(cfg.listcfg[cfg.listcfgs-1].flag[j].flag,tp); } while(*p && *p<=' ') p++; } } /* Message disabled why? ToDo */