Commit 4312181c authored by rswindell's avatar rswindell

Initializing local variables to make "gcc -Wall -O" happy.

parent 51680dd7
......@@ -709,7 +709,7 @@ void sbbs_t::batch_add_list(char *list)
sprintf(f.name,"%.12s",str);
strupr(f.name);
lncntr=0;
for(i=k=0;i<usrlibs;i++) {
for(i=j=k=0;i<usrlibs;i++) {
for(j=0;j<usrdirs[i];j++,k++) {
outchar('.');
if(k && !(k%5))
......
......@@ -709,7 +709,7 @@ void sbbs_t::privchat(bool local)
char tmp[512];
uchar ch;
int in,out,i,n,echo=1,x,y,activity,remote_activity;
int local_y,remote_y;
int local_y=1,remote_y=1;
node_t node;
if(useron.rest&FLAG('C')) {
......@@ -1202,7 +1202,7 @@ int sbbs_t::getnodetopage(int all, int telegram)
/****************************************************************************/
void sbbs_t::nodemsg()
{
char str[256],line[256],buf[512],logbuf[512],ch;
char str[256],line[256],buf[512],logbuf[512],ch=0;
char tmp[512];
int i,usernumber,done=0;
node_t node,savenode;
......
......@@ -505,7 +505,7 @@ void sbbs_t::freevars(csi_t *bin)
char * sbbs_t::copystrvar(csi_t *csi, char *p, char *str)
{
char *np; /* New pointer after realloc */
int i;
int i=0;
if(p!=csi->str) {
if(p)
......
......@@ -339,7 +339,7 @@ int sbbs_t::exec_file(csi_t *csi)
return(0);
padfname(csi->str,f.name);
strupr(f.name);
for(x=0;x<usrlibs;x++) {
for(x=y=0;x<usrlibs;x++) {
for(y=0;y<usrdirs[x];y++)
if(findfile(&cfg,usrdir[x][y],f.name))
break;
......
......@@ -42,8 +42,8 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
{
char str[512],tmp[512],buf[1025],ch,op,*p,**pp,**pp1,**pp2;
ushort w;
uint i,j;
long l,*lp,*lp1,*lp2;
uint i=0,j;
long l,*lp=NULL,*lp1=NULL,*lp2=NULL;
void *vp;
va_list arglist[64];
struct dirent *de;
......
......@@ -2204,7 +2204,7 @@ static void ctrl_thread(void* arg)
BOOL delfile;
BOOL tmpfile;
BOOL credits;
BOOL filedat;
BOOL filedat=FALSE;
BOOL transfer_inprogress;
BOOL transfer_aborted;
BOOL sysop=FALSE;
......@@ -2224,7 +2224,7 @@ static void ctrl_thread(void* arg)
user_t user;
time_t t;
time_t now;
time_t logintime;
time_t logintime=0;
time_t lastactive;
file_t f;
glob_t g;
......
......@@ -423,7 +423,7 @@ bool sbbs_t::noyes(char *str)
long sbbs_t::getkeys(char *keys, ulong max)
{
char str[81];
uchar ch,n=0,c;
uchar ch,n=0,c=0;
ulong i=0;
SAFECOPY(str,keys);
......
......@@ -56,7 +56,7 @@ int sbbs_t::listfiles(uint dirnum, char *filespec, int tofile, long mode)
uchar flagprompt=0;
uint i,j;
int file,found=0,lastbat=0,disp;
long l,m=0,n,anchor,next,datbuflen;
long l,m=0,n,anchor=0,next,datbuflen;
file_t f,bf[26]; /* bf is batch flagged files */
if(mode&FL_ULTIME) {
......@@ -590,9 +590,9 @@ bool sbbs_t::movefile(file_t* f, int newdir)
int sbbs_t::batchflagprompt(uint dirnum, file_t* bf, uint total
,long totalfiles)
{
char ch,c,d,str[256],fname[128],*p,remcdt,remfile;
char ch,c,d,str[256],fname[128],*p,remcdt=0,remfile=0;
char tmp[512];
uint i,j,ml,md,udir,ulib;
uint i,j,ml=0,md=0,udir,ulib;
file_t f;
for(ulib=0;ulib<usrlibs;ulib++)
......@@ -853,7 +853,7 @@ int sbbs_t::listfileinfo(uint dirnum, char *filespec, long mode)
int error;
int found=0;
uint i,j;
long usrxfrlen;
long usrxfrlen=0;
long m,l;
long usrcdt;
time_t start,end,t;
......
......@@ -1150,7 +1150,7 @@ static void smtp_thread(void* arg)
ushort xlat;
ushort nettype;
uint usernum;
ulong crc;
ulong crc=0;
ulong lines=0;
ulong length;
ulong offset;
......
......@@ -47,7 +47,7 @@
ulong sbbs_t::msgtoqwk(smbmsg_t* msg, FILE *qwk_fp, long mode, int subnum
, int conf)
{
char str[512],from[512],to[512],ch,tear=0,tearwatch=0,HUGE16 *buf,*p;
char str[512],from[512],to[512],ch=0,tear=0,tearwatch=0,HUGE16 *buf,*p;
char tmp[512];
long l,size=0,offset;
int i;
......
......@@ -432,7 +432,7 @@ int main(int argc, char **argv)
int i,j,mode=0,misc;
int modify=0;
int loop=0;
long value;
long value=0;
node_t node;
printf("\nSynchronet Node Display/Control Utility v1.10 Copyright 2000 Rob Swindell\n\n");
......
......@@ -45,8 +45,8 @@
void sbbs_t::putnodedat(uint number, node_t* node)
{
char str[256],firston[25];
int wr;
int wrerr;
int wr=0;
int wrerr=0;
int attempts;
if(!number)
......
......@@ -850,13 +850,13 @@ void sbbs_t::qwkcfgline(char *buf,uint subnum)
}
if(!strncmp(str,"RESETALL ",9)) { /* set all ptrs */
for(x=0;x<usrgrps;x++)
for(x=y=0;x<usrgrps;x++)
for(y=0;y<usrsubs[x];y++)
if(subscan[usrsub[x][y]].cfg&SUB_CFG_NSCAN)
qwksetptr(usrsub[x][y],str+9,1); }
else if(!strncmp(str,"ALLPTR ",7)) { /* set all ptrs */
for(x=0;x<usrgrps;x++)
for(x=y=0;x<usrgrps;x++)
for(y=0;y<usrsubs[x];y++)
if(subscan[usrsub[x][y]].cfg&SUB_CFG_NSCAN)
qwksetptr(usrsub[x][y],str+7,1); }
......@@ -936,7 +936,7 @@ void sbbs_t::qwkcfgline(char *buf,uint subnum)
else if(!strncmp(str,"FREQ ",5)) { /* file request */
padfname(str+5,f.name);
strupr(f.name);
for(x=0;x<usrlibs;x++) {
for(x=y=0;x<usrlibs;x++) {
for(y=0;y<usrdirs[x];y++)
if(findfile(&cfg,usrdir[x][y],f.name))
break;
......
......@@ -389,6 +389,8 @@ void sbbs_t::readmail(uint usernumber, int which)
replied=email(1,str2,msg.subj,WM_EMAIL|WM_QUOTE);
else if((i=finduser(str))!=0)
replied=email(i,str2,msg.subj,WM_EMAIL|WM_QUOTE);
else
replied=false;
sprintf(str2,text[DeleteMailQ],msg.from); }
if(replied==true && !(msg.hdr.attr&MSG_REPLIED)) {
......
......@@ -186,7 +186,7 @@ int matchnode(faddr_t addr, int exact)
void read_echo_cfg()
{
uchar str[1025],tmp[512],*p,*tp;
short attr;
short attr=0;
int i,j,file;
FILE *stream;
faddr_t addr,route_addr;
......
......@@ -3499,9 +3499,10 @@ int import_netmail(char *path,fmsghdr_t hdr, FILE *fidomsg)
******************************************************************************/
void export_echomail(char *sub_code,faddr_t addr)
{
char str[1025],tear,cr,HUGE16 *buf;
uchar HUGE16 *fmsgbuf=NULL;
int g,i,j,k,file;
char str[1025],tear,cr;
char* buf=NULL;
uchar* fmsgbuf=NULL;
int g,i,j,k=0,file;
ulong f,l,m,exp,ptr,msgs,lastmsg,posts,exported=0;
float export_time;
smbmsg_t msg;
......
......@@ -498,7 +498,8 @@ bool sbbs_t::inputnstime(time_t *dt)
int hour;
struct tm tm;
struct tm * tp;
char pm,str[256];
bool pm=false;
char str[256];
bputs(text[NScanDate]);
bputs(timestr(dt));
......@@ -546,14 +547,14 @@ bool sbbs_t::inputnstime(time_t *dt)
hour=tm.tm_hour;
else {
if(tm.tm_hour==0) { /* 12 midnite */
pm=0;
pm=false;
hour=12; }
else if(tm.tm_hour>12) {
hour=tm.tm_hour-12;
pm=1; }
pm=true; }
else {
hour=tm.tm_hour;
pm=0; } }
pm=false; } }
ultoa(hour,str,10);
if(!getstr(str,2,K_EDIT|K_AUTODEL|K_NUMBER|K_NOCRLF) || sys_status&SS_ABORT) {
CRLF;
......
......@@ -338,7 +338,7 @@ void sbbs_t::extract(uint dirnum)
break; }
if(i==usrdirs[curlib]) { /* not found in cur lib */
bputs(text[SearchingAllLibs]);
for(i=0;i<usrlibs;i++) {
for(i=j=0;i<usrlibs;i++) {
if(i==curlib) continue;
for(j=0;j<usrdirs[i] && !msgabort();j++)
if(findfile(&cfg,usrdir[i][j],f.name))
......@@ -420,7 +420,7 @@ ulong sbbs_t::create_filelist(char *name, long mode)
if(mode&FL_ULTIME) {
sprintf(str,"New files since: %s\r\n",timestr(&ns_time));
write(file,str,strlen(str)); }
for(i=d=0;i<usrlibs;i++) {
for(i=j=d=0;i<usrlibs;i++) {
for(j=0;j<usrdirs[i];j++,d++) {
outchar('.');
if(d && !(d%5))
......
......@@ -684,8 +684,8 @@ int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* fp)
/****************************************************************************/
int DLLCALL putnodedat(scfg_t* cfg, uint number, node_t* node, int file)
{
size_t wr;
int wrerr;
size_t wr=0;
int wrerr=0;
int attempts;
if(!number || number>cfg->sys_nodes || file<0) {
......
......@@ -62,7 +62,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
char msgtmp[MAX_PATH+1];
char tmp[512];
int i,j,file,linesquoted=0;
long length,qlen,qtime,ex_mode=0;
long length,qlen=0,qtime=0,ex_mode=0;
ulong l;
FILE * stream;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment