Commit 14bc0877 authored by rswindell's avatar rswindell
Browse files

Eliminate warnings exposed by gcc -O.

parent 3c90e9f7
......@@ -1546,6 +1546,8 @@ void DLLCALL services_thread(void* arg)
client_addr_len = sizeof(client_addr);
udp_len=0;
if(service[i].options&SERVICE_OPT_UDP) {
/* UDP */
if((udp_buf = (BYTE*)calloc(1, MAX_UDP_BUF_LEN)) == NULL) {
......
......@@ -610,7 +610,7 @@ char DLLCALL getage(scfg_t* cfg, char *birth)
int DLLCALL getnodedat(scfg_t* cfg, uint number, node_t *node, int* fp)
{
char str[MAX_PATH+1];
int count;
int count=0;
int file;
if(!number || number>cfg->sys_nodes)
......
......@@ -543,7 +543,7 @@ ulong sbbs_t::msgeditor(char *buf, char *top, char *title)
if((str[lines]=(char *)MALLOC(MAX_LINE_LEN))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,MAX_LINE_LEN);
for(i=0;i<lines;i++)
FREE(str[lines]);
FREE(str[i]);
FREE(str);
if(online==ON_REMOTE)
rioctl(IOSM|ABORT);
......@@ -561,14 +561,17 @@ ulong sbbs_t::msgeditor(char *buf, char *top, char *title)
/***
bprintf("\r\nMessage editor: Expanded tab on line #%d",lines+1);
***/ }
else str[lines][i]=buf[l]; }
else str[lines][i]=buf[l];
}
if(i==79) {
if(buf[l]==CR)
l+=2;
else
bprintf("\r\nMessage editor: Split line #%d",lines+1); }
bprintf("\r\nMessage editor: Split line #%d",lines+1);
}
str[lines][i]=0;
lines++; }
lines++;
}
if(lines)
bprintf("\r\nMessage editor: Read in %d lines\r\n",lines);
bprintf(text[EnterMsgNow],maxlines);
......@@ -577,10 +580,12 @@ ulong sbbs_t::msgeditor(char *buf, char *top, char *title)
if(fexist(path))
menu("msgtabs");
else {
for(i=0;i<79;i++)
for(i=0;i<79;i++) {
if(i%TABSIZE || !i)
outchar('-');
else outchar('+');
else
outchar('+');
}
CRLF;
}
putmsg(top,P_SAVEATR|P_NOATCODES);
......@@ -702,6 +707,8 @@ ulong sbbs_t::msgeditor(char *buf, char *top, char *title)
FREE(str[line]);
if(lines)
i=!noyes(text[WithLineNumbersQ]);
else
i=0;
CRLF;
attr(LIGHTGRAY);
putmsg(top,P_SAVEATR|P_NOATCODES);
......@@ -763,12 +770,14 @@ ulong sbbs_t::msgeditor(char *buf, char *top, char *title)
for(i=0;i<lines;i++)
FREE(str[i]);
FREE(str);
return(0); }
return(0);
}
strcpy(buf,top);
for(i=0;i<lines;i++) {
strcat(buf,str[i]);
strcat(buf,crlf);
FREE(str[i]); }
FREE(str[i]);
}
FREE(str);
return(lines);
}
......
......@@ -253,7 +253,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
bool native=false; // DOS program by default
bool nt=false; // WinNT/2K?
bool was_online=true;
bool rio_abortable_save;
bool rio_abortable_save=rio_abortable;
bool use_pipes=false; // NT-compatible console redirection
uint i;
time_t hungup=0;
......@@ -629,10 +629,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
ReleaseMutex(exec_mutex);
/* Disable Ctrl-C checking */
if(!(mode&EX_OFFLINE)) {
rio_abortable_save=rio_abortable;
if(!(mode&EX_OFFLINE))
rio_abortable=false;
}
// Executing app in foreground?, monitor
retval=STILL_ACTIVE;
......@@ -1069,7 +1067,7 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
ulong avail;
ulong output_len;
bool native=false; // DOS program by default
bool rio_abortable_save;
bool rio_abortable_save=rio_abortable;
int i;
int rd;
int wr;
......@@ -1276,10 +1274,8 @@ int sbbs_t::external(const char* cmdline, long mode, const char* startup_dir)
lprintf("Node %d executing external: %s",cfg.node_num,fullcmdline);
/* Disable Ctrl-C checking */
if(!(mode&EX_OFFLINE)) {
rio_abortable_save=rio_abortable;
if(!(mode&EX_OFFLINE))
rio_abortable=false;
}
if(mode&EX_OUTR) {
if(!(mode&EX_INR))
......
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