Commit 6bebc963 authored by deuce's avatar deuce
Browse files

Fix pretty much all of the Visual Studio Express 2013 warnings.

parent 1c82adc3
......@@ -120,6 +120,7 @@ int main(int argc, char **argv)
arcdef_t savarcdef;
BOOL door_mode=FALSE;
int ciolib_mode=CIOLIB_MODE_AUTO;
unsigned int u, u2;
fprintf(stderr,"\nSBBSecho Configuration Version %u.%02u Copyright %s "
"Rob Swindell\n\n",SBBSECHO_VERSION_MAJOR, SBBSECHO_VERSION_MINOR, __DATE__+7);
......@@ -327,9 +328,9 @@ int main(int argc, char **argv)
"uplink nodes.\r\n";
i=0;
while(1) {
for(j=0;j<cfg.nodecfgs;j++)
strcpy(opt[j],wcfaddrtoa(&cfg.nodecfg[j].faddr));
opt[j][0]=0;
for(u=0;u<cfg.nodecfgs;u++)
strcpy(opt[u],wcfaddrtoa(&cfg.nodecfg[u].faddr));
opt[u][0]=0;
i=uifc.list(WIN_ORG|WIN_INS|WIN_DEL|WIN_ACT|WIN_GET|WIN_PUT
|WIN_INSACT|WIN_DELACT|WIN_XTR
,0,0,0,&i,0,"Nodes",opt);
......@@ -363,8 +364,8 @@ int main(int argc, char **argv)
if(cfg.nodecfgs<=0) {
cfg.nodecfgs=0;
continue; }
for(j=i;j<cfg.nodecfgs;j++)
memcpy(&cfg.nodecfg[j],&cfg.nodecfg[j+1]
for(u=i;u<cfg.nodecfgs;u++)
memcpy(&cfg.nodecfg[u],&cfg.nodecfg[u+1]
,sizeof(nodecfg_t));
if((cfg.nodecfg=(nodecfg_t *)realloc(cfg.nodecfg
,sizeof(nodecfg_t)*(cfg.nodecfgs)))==NULL) {
......@@ -435,17 +436,17 @@ int main(int argc, char **argv)
"~ Archive Type ~\r\n\r\n"
"This is the compression type that will be used for compressing packets\r\n"
"to and decompressing packets from this node.\r\n";
for(j=0;j<cfg.arcdefs;j++)
strcpy(opt[j],cfg.arcdef[j].name);
strcpy(opt[j++],"None");
opt[j][0]=0;
if(cfg.nodecfg[i].arctype<j)
j=cfg.nodecfg[i].arctype;
k=uifc.list(WIN_RHT|WIN_SAV,0,0,0,&j,0
for(u=0;u<cfg.arcdefs;u++)
strcpy(opt[u],cfg.arcdef[u].name);
strcpy(opt[u++],"None");
opt[u][0]=0;
if(cfg.nodecfg[i].arctype<u)
u=cfg.nodecfg[i].arctype;
k=uifc.list(WIN_RHT|WIN_SAV,0,0,0,&u,0
,"Archive Type",opt);
if(k==-1)
break;
if(k>=cfg.arcdefs)
if((unsigned)k>=cfg.arcdefs)
cfg.nodecfg[i].arctype=0xffff;
else
cfg.nodecfg[i].arctype=k;
......@@ -896,9 +897,9 @@ int main(int argc, char **argv)
"compressing outgoing packets.\r\n";
i=0;
while(1) {
for(j=0;j<cfg.arcdefs;j++)
sprintf(opt[j],"%-30.30s",cfg.arcdef[j].name);
opt[j][0]=0;
for(u=0;u<cfg.arcdefs;u++)
sprintf(opt[u],"%-30.30s",cfg.arcdef[u].name);
opt[u][0]=0;
i=uifc.list(WIN_ORG|WIN_INS|WIN_DEL|WIN_ACT|WIN_GET|WIN_PUT
|WIN_INSACT|WIN_DELACT|WIN_XTR
,0,0,0,&i,0,"Archive Programs",opt);
......@@ -933,8 +934,8 @@ int main(int argc, char **argv)
if(cfg.arcdefs<=0) {
cfg.arcdefs=0;
continue; }
for(j=i;j<cfg.arcdefs;j++)
memcpy(&cfg.arcdef[j],&cfg.arcdef[j+1]
for(u=i;u<cfg.arcdefs;u++)
memcpy(&cfg.arcdef[u],&cfg.arcdef[u+1]
,sizeof(arcdef_t));
if((cfg.arcdef=(arcdef_t *)realloc(cfg.arcdef
,sizeof(arcdef_t)*(cfg.arcdefs)))==NULL) {
......@@ -1003,9 +1004,9 @@ int main(int argc, char **argv)
"AREAS.BBS file) for SBBSecho to search for area add requests.\r\n";
i=0;
while(1) {
for(j=0;j<cfg.listcfgs;j++)
sprintf(opt[j],"%-50.50s",cfg.listcfg[j].listpath);
opt[j][0]=0;
for(u=0;u<cfg.listcfgs;u++)
sprintf(opt[u],"%-50.50s",cfg.listcfg[u].listpath);
opt[u][0]=0;
i=uifc.list(WIN_ORG|WIN_INS|WIN_DEL|WIN_ACT|WIN_GET|WIN_PUT
|WIN_INSACT|WIN_DELACT|WIN_XTR
,0,0,0,&i,0,"Additional Echo Lists",opt);
......@@ -1039,8 +1040,8 @@ int main(int argc, char **argv)
if(cfg.listcfgs<=0) {
cfg.listcfgs=0;
continue; }
for(j=i;j<cfg.listcfgs;j++)
memcpy(&cfg.listcfg[j],&cfg.listcfg[j+1]
for(u=i;u<cfg.listcfgs;u++)
memcpy(&cfg.listcfg[u],&cfg.listcfg[u+1]
,sizeof(echolist_t));
if((cfg.listcfg=(echolist_t *)realloc(cfg.listcfg
,sizeof(echolist_t)*(cfg.listcfgs)))==NULL) {
......@@ -1068,8 +1069,8 @@ int main(int argc, char **argv)
sprintf(opt[j++],"%-20.20s %s","Forward Requests"
,(cfg.listcfg[i].misc&NOFWD) ? "No" : "Yes");
str[0]=0;
for(k=0;k<cfg.listcfg[i].numflags;k++) {
strcat(str,cfg.listcfg[i].flag[k].flag);
for(u=0;u<cfg.listcfg[i].numflags;u++) {
strcat(str,cfg.listcfg[i].flag[u].flag);
strcat(str," "); }
sprintf(opt[j++],"%-20.20s %s","Echo List Flags",str);
opt[j][0]=0;
......@@ -1111,9 +1112,9 @@ int main(int argc, char **argv)
break;
case 4:
while(1) {
for(j=0;j<cfg.listcfg[i].numflags;j++)
strcpy(opt[j],cfg.listcfg[i].flag[j].flag);
opt[j][0]=0;
for(u=0;u<cfg.listcfg[i].numflags;u++)
strcpy(opt[u],cfg.listcfg[i].flag[u].flag);
opt[u][0]=0;
x=uifc.list(WIN_SAV|WIN_INS|WIN_DEL|WIN_ACT|
WIN_XTR|WIN_INSACT|WIN_DELACT|WIN_RHT
,0,0,0,&x,0,"Echo List Flags",opt);
......@@ -1152,9 +1153,9 @@ int main(int argc, char **argv)
if(cfg.listcfg[i].numflags<=0) {
cfg.listcfg[i].numflags=0;
continue; }
for(j=x;j<cfg.listcfg[i].numflags;j++)
strcpy(cfg.listcfg[i].flag[j].flag
,cfg.listcfg[i].flag[j+1].flag);
for(u=x;u<cfg.listcfg[i].numflags;u++)
strcpy(cfg.listcfg[i].flag[u].flag
,cfg.listcfg[i].flag[u+1].flag);
if((cfg.listcfg[i].flag=(flag_t *)
realloc(cfg.listcfg[i].flag
,sizeof(flag_t)*
......@@ -1250,113 +1251,113 @@ int main(int argc, char **argv)
fprintf(stream,"ARCSIZE %lu\n",cfg.maxbdlsize);
if(cfg.maxpktsize!=DFLT_PKT_SIZE)
fprintf(stream,"PKTSIZE %lu\n",cfg.maxpktsize);
for(i=j=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].attr&SEND_NOTIFY) {
for(u=j=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].attr&SEND_NOTIFY) {
if(!j) fprintf(stream,"SEND_NOTIFY");
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[i].faddr));
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u].faddr));
j++; }
if(j) fprintf(stream,"\n");
for(i=j=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].attr&ATTR_HOLD) {
for(u=j=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].attr&ATTR_HOLD) {
if(!j) fprintf(stream,"HOLD");
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[i].faddr));
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u].faddr));
j++; }
if(j) fprintf(stream,"\n");
for(i=j=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].attr&ATTR_DIRECT) {
for(u=j=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].attr&ATTR_DIRECT) {
if(!j) fprintf(stream,"DIRECT");
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[i].faddr));
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u].faddr));
j++; }
if(j) fprintf(stream,"\n");
for(i=j=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].attr&ATTR_CRASH) {
for(u=j=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].attr&ATTR_CRASH) {
if(!j) fprintf(stream,"CRASH");
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[i].faddr));
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u].faddr));
j++; }
if(j) fprintf(stream,"\n");
for(i=j=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].attr&ATTR_PASSIVE) {
for(u=j=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].attr&ATTR_PASSIVE) {
if(!j) fprintf(stream,"PASSIVE");
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[i].faddr));
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u].faddr));
j++; }
if(j) fprintf(stream,"\n");
for(i=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].pktpwd[0])
for(u=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].pktpwd[0])
fprintf(stream,"PKTPWD %s %s\n"
,wcfaddrtoa(&cfg.nodecfg[i].faddr),cfg.nodecfg[i].pktpwd);
,wcfaddrtoa(&cfg.nodecfg[u].faddr),cfg.nodecfg[u].pktpwd);
for(i=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].pkt_type)
for(u=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].pkt_type)
fprintf(stream,"PKTTYPE %s %s\n"
,cfg.nodecfg[i].pkt_type==PKT_TWO_TWO ? "2.2":"2"
,wcfaddrtoa(&cfg.nodecfg[i].faddr));
,cfg.nodecfg[u].pkt_type==PKT_TWO_TWO ? "2.2":"2"
,wcfaddrtoa(&cfg.nodecfg[u].faddr));
for(i=0;i<cfg.arcdefs;i++)
for(u=0;u<cfg.arcdefs;u++)
fprintf(stream,"PACKER %s %u %s\n PACK %s\n"
" UNPACK %s\nEND\n"
,cfg.arcdef[i].name
,cfg.arcdef[i].byteloc
,cfg.arcdef[i].hexid
,cfg.arcdef[i].pack
,cfg.arcdef[i].unpack
,cfg.arcdef[u].name
,cfg.arcdef[u].byteloc
,cfg.arcdef[u].hexid
,cfg.arcdef[u].pack
,cfg.arcdef[u].unpack
);
for(i=0;i<cfg.arcdefs;i++) {
for(j=k=0;j<cfg.nodecfgs;j++)
if(cfg.nodecfg[j].arctype==i) {
for(u=0;u<cfg.arcdefs;u++) {
for(u2=k=0;u2<cfg.nodecfgs;u2++)
if(cfg.nodecfg[u2].arctype==u) {
if(!k)
fprintf(stream,"%-10s %s","USEPACKER"
,cfg.arcdef[i].name);
,cfg.arcdef[u].name);
k++;
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[j].faddr)); }
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u2].faddr)); }
if(k)
fprintf(stream,"\n"); }
for(i=j=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].arctype==0xffff) {
for(u=j=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].arctype==0xffff) {
if(!j)
fprintf(stream,"%-10s %s","USEPACKER","NONE");
j++;
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[i].faddr)); }
fprintf(stream," %s",wcfaddrtoa(&cfg.nodecfg[u].faddr)); }
if(j)
fprintf(stream,"\n");
for(i=0;i<cfg.listcfgs;i++) {
for(u=0;u<cfg.listcfgs;u++) {
fprintf(stream,"%-10s","ECHOLIST");
if(cfg.listcfg[i].password[0])
if(cfg.listcfg[u].password[0])
fprintf(stream," FORWARD %s %s"
,wcfaddrtoa(&cfg.listcfg[i].forward)
,cfg.listcfg[i].password);
else if(cfg.listcfg[i].misc&NOFWD &&
cfg.listcfg[i].forward.zone)
,wcfaddrtoa(&cfg.listcfg[u].forward)
,cfg.listcfg[u].password);
else if(cfg.listcfg[u].misc&NOFWD &&
cfg.listcfg[u].forward.zone)
fprintf(stream," HUB %s"
,wcfaddrtoa(&cfg.listcfg[i].forward));
fprintf(stream," %s",cfg.listcfg[i].listpath);
for(j=0;j<cfg.listcfg[i].numflags;j++)
fprintf(stream," %s",cfg.listcfg[i].flag[j].flag);
,wcfaddrtoa(&cfg.listcfg[u].forward));
fprintf(stream," %s",cfg.listcfg[u].listpath);
for(u2=0;u2<cfg.listcfg[u].numflags;u2++)
fprintf(stream," %s",cfg.listcfg[u].flag[u2].flag);
fprintf(stream,"\n"); }
for(i=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].password[0]) {
for(u=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].password[0]) {
fprintf(stream,"%-10s %s %s","AREAFIX"
,wcfaddrtoa(&cfg.nodecfg[i].faddr)
,cfg.nodecfg[i].password);
for(j=0;j<cfg.nodecfg[i].numflags;j++)
fprintf(stream," %s",cfg.nodecfg[i].flag[j].flag);
,wcfaddrtoa(&cfg.nodecfg[u].faddr)
,cfg.nodecfg[u].password);
for(u2=0;u2<cfg.nodecfg[u].numflags;u2++)
fprintf(stream," %s",cfg.nodecfg[u].flag[u2].flag);
fprintf(stream,"\n"); }
for(i=0;i<cfg.nodecfgs;i++)
if(cfg.nodecfg[i].route.zone) {
for(u=0;u<cfg.nodecfgs;u++)
if(cfg.nodecfg[u].route.zone) {
fprintf(stream,"%-10s %s","ROUTE_TO"
,wcfaddrtoa(&cfg.nodecfg[i].route));
,wcfaddrtoa(&cfg.nodecfg[u].route));
fprintf(stream," %s"
,wcfaddrtoa(&cfg.nodecfg[i].faddr));
for(j=i+1;j<cfg.nodecfgs;j++)
if(!memcmp(&cfg.nodecfg[j].route,&cfg.nodecfg[i].route
,wcfaddrtoa(&cfg.nodecfg[u].faddr));
for(u2=u+1;u2<cfg.nodecfgs;u2++)
if(!memcmp(&cfg.nodecfg[u2].route,&cfg.nodecfg[u].route
,sizeof(faddr_t))) {
fprintf(stream," %s"
,wcfaddrtoa(&cfg.nodecfg[j].faddr));
cfg.nodecfg[j].route.zone=0; }
,wcfaddrtoa(&cfg.nodecfg[u2].faddr));
cfg.nodecfg[u2].route.zone=0; }
fprintf(stream,"\n"); }
fclose(stream);
......
......@@ -2713,7 +2713,7 @@ static void ctrl_thread(void* arg)
SAFECOPY(user.modem,"FTP");
SAFECOPY(user.comp,host_name);
SAFECOPY(user.ipaddr,host_ip);
user.logontime=logintime;
user.logontime=(time32_t)logintime;
putuserdat(&scfg, &user);
continue;
......
......@@ -376,7 +376,8 @@ SOCKET DLLCALL js_socket_add(JSContext *cx, jsval val, fd_set *fds)
js_socket_private_t *p;
JSClass* cl;
SOCKET sock=INVALID_SOCKET;
int32 i;
size_t i;
int32_t intval;
if(JSVAL_IS_OBJECT(val) && (cl=JS_GetClass(cx,JSVAL_TO_OBJECT(val)))!=NULL) {
if(cl->flags&JSCLASS_HAS_PRIVATE) {
......@@ -398,8 +399,8 @@ SOCKET DLLCALL js_socket_add(JSContext *cx, jsval val, fd_set *fds)
}
}
} else if(val!=JSVAL_VOID) {
if(JS_ValueToInt32(cx,val,&i)) {
sock = i;
if(JS_ValueToInt32(cx,val,&intval)) {
sock = intval;
FD_SET(sock, fds);
}
}
......@@ -410,7 +411,8 @@ BOOL DLLCALL js_socket_isset(JSContext *cx, jsval val, fd_set *fds)
{
js_socket_private_t *p;
JSClass* cl;
int i;
size_t i;
int intval;
if(JSVAL_IS_OBJECT(val) && (cl=JS_GetClass(cx,JSVAL_TO_OBJECT(val)))!=NULL) {
if(cl->flags&JSCLASS_HAS_PRIVATE) {
......@@ -430,8 +432,8 @@ BOOL DLLCALL js_socket_isset(JSContext *cx, jsval val, fd_set *fds)
}
}
} else if(val!=JSVAL_VOID) {
if(JS_ValueToInt32(cx,val,&i)) {
if(FD_ISSET(i, fds))
if(JS_ValueToInt32(cx,val,&intval)) {
if(FD_ISSET(intval, fds))
return TRUE;
}
}
......@@ -1543,7 +1545,7 @@ js_poll(JSContext *cx, uintN argc, jsval *arglist)
int result;
struct timeval tv = {0, 0};
jsrefcount rc;
int i;
size_t i;
SOCKET high=0;
JS_SET_RVAL(cx, arglist, JSVAL_VOID);
......
......@@ -763,12 +763,12 @@ static void pop3_thread(void* arg)
int rd;
BOOL activity=TRUE;
BOOL apop=FALSE;
long l;
uint32_t l;
ulong lines;
ulong lines_sent;
ulong login_attempts;
uint32_t msgs;
long msgnum;
uint32_t msgnum;
ulong bytes;
SOCKET socket;
smb_t smb;
......@@ -1072,9 +1072,9 @@ static void pop3_thread(void* arg)
p=buf+4;
SKIP_WHITESPACE(p);
if(isdigit((uchar)*p)) {
msgnum=atol(p);
msgnum=strtoul(p, NULL, 10);
if(msgnum<1 || msgnum>msgs) {
lprintf(LOG_NOTICE,"%04d !POP3 INVALID message #%ld"
lprintf(LOG_NOTICE,"%04d !POP3 INVALID message #%" PRIu32
,socket, msgnum);
sockprintf(socket,"-ERR no such message");
continue;
......@@ -1108,9 +1108,9 @@ static void pop3_thread(void* arg)
continue;
}
if(!strnicmp(buf, "LIST",4)) {
sockprintf(socket,"+OK %lu %lu",msgnum,smb_getmsgtxtlen(&msg));
sockprintf(socket,"+OK %" PRIu32 " %lu",msgnum,smb_getmsgtxtlen(&msg));
} else /* UIDL */
sockprintf(socket,"+OK %lu %lu",msgnum,msg.hdr.number);
sockprintf(socket,"+OK %" PRIu32 " %lu",msgnum,msg.hdr.number);
smb_freemsgmem(&msg);
continue;
......@@ -1157,7 +1157,7 @@ static void pop3_thread(void* arg)
lines=-1;
p=buf+4;
SKIP_WHITESPACE(p);
msgnum=atol(p);
msgnum=strtoul(p, NULL, 10);
if(!strnicmp(buf,"TOP ",4)) {
SKIP_DIGIT(p);
......@@ -1165,7 +1165,7 @@ static void pop3_thread(void* arg)
lines=atol(p);
}
if(msgnum<1 || msgnum>msgs) {
lprintf(LOG_NOTICE,"%04d !POP3 %s ATTEMPTED to retrieve an INVALID message #%ld"
lprintf(LOG_NOTICE,"%04d !POP3 %s ATTEMPTED to retrieve an INVALID message #%" PRIu32
,socket, user.alias, msgnum);
sockprintf(socket,"-ERR no such message");
continue;
......@@ -1257,10 +1257,10 @@ static void pop3_thread(void* arg)
if(!strnicmp(buf, "DELE ",5)) {
p=buf+5;
SKIP_WHITESPACE(p);
msgnum=atol(p);
msgnum=strtoul(p, NULL, 10);
if(msgnum<1 || msgnum>msgs) {
lprintf(LOG_NOTICE,"%04d !POP3 %s ATTEMPTED to delete an INVALID message #%ld"
lprintf(LOG_NOTICE,"%04d !POP3 %s ATTEMPTED to delete an INVALID message #%" PRIu32
,socket, user.alias, msgnum);
sockprintf(socket,"-ERR no such message");
continue;
......@@ -5238,7 +5238,7 @@ void DLLCALL mail_server(void* arg)
while(!terminated && !terminate_server) {
if(protected_uint32_value(thread_count) <= 1+sendmail_running) {
if(protected_uint32_value(thread_count) <= (unsigned int)(1+(sendmail_running?1:0))) {
if(!(startup->options&MAIL_OPT_NO_RECYCLE)) {
if((p=semfile_list_check(&initialized,recycle_semfiles))!=NULL) {
lprintf(LOG_INFO,"Recycle semaphore file (%s) detected",p);
......
......@@ -883,7 +883,7 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
domsg=0;
if((i64=get_start_msg(this,&smb))<0)
break;
i=i64;
i=(int)i64;
listmsgs(subnum,0,post,i,smb.msgs);
sys_status&=~SS_ABORT;
break;
......
......@@ -137,7 +137,7 @@ faddr_t atofaddr(char *instr)
******************************************************************************/
int matchnode(faddr_t addr, int exact)
{
int i;
uint i;
if(exact!=2) {
for(i=0;i<cfg.nodecfgs;i++) /* Look for exact match */
......@@ -185,6 +185,7 @@ void read_echo_cfg()
char tmp[512],*p,*tp;
short attr=0;
int i,j,file;
uint u;
FILE *stream;
faddr_t addr,route_addr;
......@@ -393,12 +394,12 @@ void read_echo_cfg()
continue;
*p=0;
p++;
for(i=0;i<cfg.arcdefs;i++)
if(!strnicmp(cfg.arcdef[i].name,str
,strlen(cfg.arcdef[i].name)))
for(u=0;u<cfg.arcdefs;u++)
if(!strnicmp(cfg.arcdef[u].name,str
,strlen(cfg.arcdef[u].name)))
break;
if(i==cfg.arcdefs) /* i = number of arcdef til done */
i=0xffff; /* Uncompressed type if not found */
if(u==cfg.arcdefs) /* i = number of arcdef til done */
u=0xffff; /* Uncompressed type if not found */
while(*p) {
SKIPCTRLSP(p);
if(!*p)
......@@ -415,7 +416,7 @@ void read_echo_cfg()
bail(1); }
memset(&cfg.nodecfg[j],0,sizeof(nodecfg_t));
cfg.nodecfg[j].faddr=addr; }
cfg.nodecfg[j].arctype=i; } }
cfg.nodecfg[j].arctype=u; } }
if(!stricmp(tmp,"PKTPWD")) { /* Packet Password */
if(!*p)
......@@ -626,19 +627,19 @@ void read_echo_cfg()
SKIPCODE(p); /* Find end of this flag */
*p=0; /* and terminate it */
++p;
for(j=0;j<cfg.listcfg[cfg.listcfgs-1].numflags;j++)
if(!strnicmp(cfg.listcfg[cfg.listcfgs-1].flag[j].flag,tp
,strlen(cfg.listcfg[cfg.listcfgs-1].flag[j].flag)))
for(u=0;u<cfg.listcfg[cfg.listcfgs-1].numflags;u++)
if(!strnicmp(cfg.listcfg[cfg.listcfgs-1].flag[u].flag,tp
,strlen(cfg.listcfg[cfg.listcfgs-1].flag[u].flag)))
break;
if(j==cfg.listcfg[cfg.listcfgs-1].numflags) {
if(u==cfg.listcfg[cfg.listcfgs-1].numflags) {
if((cfg.listcfg[cfg.listcfgs-1].flag=
(flag_t *)realloc(cfg.listcfg[cfg.listcfgs-1].flag
,sizeof(flag_t)*(j+1)))==NULL) {
,sizeof(flag_t)*(u+1)))==NULL) {
printf("\nError allocating memory for listcfg #%u "
"flag #%u.\n",cfg.listcfgs,j+1);
"flag #%u.\n",cfg.listcfgs,u+1);
bail(1); }
cfg.listcfg[cfg.listcfgs-1].numflags++;
SAFECOPY(cfg.listcfg[cfg.listcfgs-1].flag[j].flag,tp); }
SAFECOPY(cfg.listcfg[cfg.listcfgs-1].flag[u].flag,tp); }
SKIPCTRLSP(p); } }
/* Message disabled why? ToDo */
......
......@@ -1691,7 +1691,8 @@ void DLLCALL services_thread(void* arg)
SOCKET client_socket;
BYTE* udp_buf = NULL;
int udp_len;
int i,j;
int i;
size_t j;
int result;
int optval;
ulong total_running;
......
......@@ -4,6 +4,7 @@
#include "sbbs.h" // For DLLEXPORT
#include <cryptlib.h>
#include "scfgdefs.h"
#include "wrapdll.h"
#define SSL_ESTR_LEN CRYPT_MAX_TEXTSIZE + 1024 /* File name, line number, status code, and some static text */
......
......@@ -218,7 +218,7 @@ void add_bruted(unsigned long name, char good, char *val, int save)
int check_bruted(long name,unsigned char *val)
{
int i;
size_t i;
for(i=0; i<bruted_len; i++) {
if(*(int32_t *)bruted[i]==name) {
......@@ -231,7 +231,7 @@ int check_bruted(long name,unsigned char *val)
char *find_bruted(long name)
{
int i;
size_t i;
for(i=0; i<bruted_len; i++) {
if(*(int32_t *)bruted[i]==name && *(bruted[i]+4))
......@@ -2355,7 +2355,7 @@ int main(int argc, char **argv)
if(good!=NULL) {
str=strtok(NULL,",");
if(str!=NULL) {
add_bruted(strtoul(crc,NULL,16),strtoul(good,NULL,10),str,0);
add_bruted(strtoul(crc,NULL,16),(char)strtoul(good,NULL,10),str,0);
}
}