Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 1aa52dba authored by deuce's avatar deuce

Scrape out some of the 16-bit cruft.

parent 53099a27
......@@ -555,14 +555,14 @@ void synclist(char *inpath, int dirnum)
printf("ERR_LEN (%ld) of %s\n",length,str);
return;
}
if((ixbbuf=(uchar HUGE16 *)MALLOC(length))==NULL) {
if((ixbbuf=(uchar *)malloc(length))==NULL) {
close(file);
printf("ERR_ALLOC %s\n",str);
return;
}
if(lread(file,ixbbuf,length)!=length) {
close(file);
FREE((char *)ixbbuf);
free((char *)ixbbuf);
printf("ERR_READ %s\n",str);
return;
}
......
......@@ -333,7 +333,7 @@ void newvar(uchar* src, uchar *in)
if(i<vars)
return;
}
if((var_name=(ulong *)REALLOC(var_name,sizeof(long)*(vars+1)))==NULL) {
if((var_name=(ulong *)realloc(var_name,sizeof(long)*(vars+1)))==NULL) {
printf("Too many (%lu) variables!\n",vars);
bail(1); }
var_name[vars]=l;
......@@ -532,18 +532,18 @@ void compile(char *src)
if(sp)
*sp=0;
truncsp(arg2);
if((define_str=(char **)REALLOC(define_str,sizeof(char *)*(defines+1)))
if((define_str=(char **)realloc(define_str,sizeof(char *)*(defines+1)))
==NULL) {
printf("Too many defines.\n");
bail(1); }
if((define_str[defines]=(char *)MALLOC(strlen(arg)+1))==NULL) {
if((define_str[defines]=(char *)malloc(strlen(arg)+1))==NULL) {
printf("Too many defines.\n");
bail(1); }
if((define_val=(char **)REALLOC(define_val,sizeof(char *)*(defines+1)))
if((define_val=(char **)realloc(define_val,sizeof(char *)*(defines+1)))
==NULL) {
printf("Too many defines.\n");
bail(1); }
if((define_val[defines]=(char *)MALLOC(strlen(arg2)+1))==NULL) {
if((define_val[defines]=(char *)malloc(strlen(arg2)+1))==NULL) {
printf("Too many defines.\n");
bail(1); }
strcpy(define_str[defines],arg);
......@@ -728,15 +728,15 @@ void compile(char *src)
printf("!SYNTAX ERROR (duplicate label name):\n");
printf(linestr,src,line,p);
bail(1); }
if((label_name=(char **)REALLOC(label_name,sizeof(char *)*(labels+1)))
if((label_name=(char **)realloc(label_name,sizeof(char *)*(labels+1)))
==NULL) {
printf("Too many labels.\n");
bail(1); }
if((label_indx=(uint *)REALLOC(label_indx,sizeof(int)*(labels+1)))
if((label_indx=(uint *)realloc(label_indx,sizeof(int)*(labels+1)))
==NULL) {
printf("Too many labels.\n");
bail(1); }
if((label_name[labels]=(char *)MALLOC(strlen(p)+1))==NULL) {
if((label_name[labels]=(char *)malloc(strlen(p)+1))==NULL) {
printf("Too many labels.\n");
bail(1); }
strcpy(label_name[labels],p);
......@@ -748,26 +748,26 @@ void compile(char *src)
sp=strchr(arg,' ');
if(sp)
*sp=0;
if((goto_label=(char **)REALLOC(goto_label,sizeof(char *)*(gotos+1)))
if((goto_label=(char **)realloc(goto_label,sizeof(char *)*(gotos+1)))
==NULL) {
printf("Too many gotos.\n");
bail(1); }
if((goto_file=(char **)REALLOC(goto_file,sizeof(char *)*(gotos+1)))
if((goto_file=(char **)realloc(goto_file,sizeof(char *)*(gotos+1)))
==NULL) {
printf("Too many gotos.\n");
bail(1); }
if((goto_indx=(uint *)REALLOC(goto_indx,sizeof(int)*(gotos+1)))
if((goto_indx=(uint *)realloc(goto_indx,sizeof(int)*(gotos+1)))
==NULL) {
printf("Too many gotos.\n");
bail(1); }
if((goto_line=(uint *)REALLOC(goto_line,sizeof(int)*(gotos+1)))
if((goto_line=(uint *)realloc(goto_line,sizeof(int)*(gotos+1)))
==NULL) {
printf("Too many gotos.\n");
bail(1); }
if((goto_label[gotos]=(char *)MALLOC(strlen(arg)+1))==NULL) {
if((goto_label[gotos]=(char *)malloc(strlen(arg)+1))==NULL) {
printf("Too many gotos.\n");
bail(1); }
if((goto_file[gotos]=(char *)MALLOC(strlen(str)+1))==NULL) {
if((goto_file[gotos]=(char *)malloc(strlen(str)+1))==NULL) {
printf("Too many gotos.\n");
bail(1); }
strcpy(goto_label[gotos],arg);
......@@ -782,26 +782,26 @@ void compile(char *src)
sp=strchr(arg,' ');
if(sp)
*sp=0;
if((call_label=(char **)REALLOC(call_label,sizeof(char *)*(calls+1)))
if((call_label=(char **)realloc(call_label,sizeof(char *)*(calls+1)))
==NULL) {
printf("Too many calls.\n");
bail(1); }
if((call_file=(char **)REALLOC(call_file,sizeof(char *)*(calls+1)))
if((call_file=(char **)realloc(call_file,sizeof(char *)*(calls+1)))
==NULL) {
printf("Too many calls.\n");
bail(1); }
if((call_indx=(uint *)REALLOC(call_indx,sizeof(int)*(calls+1)))
if((call_indx=(uint *)realloc(call_indx,sizeof(int)*(calls+1)))
==NULL) {
printf("Too many calls.\n");
bail(1); }
if((call_line=(uint *)REALLOC(call_line,sizeof(int)*(calls+1)))
if((call_line=(uint *)realloc(call_line,sizeof(int)*(calls+1)))
==NULL) {
printf("Too many calls.\n");
bail(1); }
if((call_label[calls]=(char *)MALLOC(strlen(arg)+1))==NULL) {
if((call_label[calls]=(char *)malloc(strlen(arg)+1))==NULL) {
printf("Too many calls.\n");
bail(1); }
if((call_file[calls]=(char *)MALLOC(strlen(src)+1))==NULL) {
if((call_file[calls]=(char *)malloc(strlen(src)+1))==NULL) {
printf("Too many calls.\n");
bail(1); }
......
......@@ -77,7 +77,7 @@ void sbbs_t::multinodechat(int channel)
}
bprintf(text[WelcomeToChannelN],channel,cfg.chan[channel-1]->name);
if(gurubuf) {
FREE(gurubuf);
free(gurubuf);
gurubuf=NULL; }
if(cfg.chan[channel-1]->misc&CHAN_GURU && cfg.chan[channel-1]->guru<cfg.total_gurus
&& chk_ar(cfg.guru[cfg.chan[channel-1]->guru]->ar,&useron)) {
......@@ -85,7 +85,7 @@ void sbbs_t::multinodechat(int channel)
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
return; }
if((gurubuf=(char *)MALLOC(filelength(file)+1))==NULL) {
if((gurubuf=(char *)malloc(filelength(file)+1))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,filelength(file)+1);
return; }
......@@ -211,7 +211,7 @@ void sbbs_t::multinodechat(int channel)
bputs(text[WrongPassword]);
continue; }
if(gurubuf) {
FREE(gurubuf);
free(gurubuf);
gurubuf=NULL; }
if(cfg.chan[savch-1]->misc&CHAN_GURU
&& cfg.chan[savch-1]->guru<cfg.total_gurus
......@@ -222,7 +222,7 @@ void sbbs_t::multinodechat(int channel)
if((file=nopen(str,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
break; }
if((gurubuf=(char *)MALLOC(filelength(file)+1))==NULL) {
if((gurubuf=(char *)malloc(filelength(file)+1))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str
,filelength(file)+1);
......@@ -537,7 +537,7 @@ bool sbbs_t::guru_page(void)
errormsg(WHERE,ERR_OPEN,path,O_RDONLY);
return(false);
}
if((gurubuf=(char *)MALLOC(filelength(file)+1))==NULL) {
if((gurubuf=(char *)malloc(filelength(file)+1))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,path,filelength(file)+1);
return(false);
......@@ -546,7 +546,7 @@ bool sbbs_t::guru_page(void)
gurubuf[filelength(file)]=0;
close(file);
localguru(gurubuf,i);
FREE(gurubuf);
free(gurubuf);
return(true);
}
......@@ -632,7 +632,7 @@ void sbbs_t::chatsection()
default: /* 'Q' or <CR> */
lncntr=0;
// if(gurubuf)
// FREE(gurubuf);
// free(gurubuf);
return; }
action=NODE_CHAT;
if(!(useron.misc&EXPERT) || useron.misc&(WIP|HTML)
......@@ -642,7 +642,7 @@ void sbbs_t::chatsection()
ASYNC;
bputs(text[ChatPrompt]); }
// if(gurubuf)
// FREE(gurubuf);
// free(gurubuf);
}
/****************************************************************************/
......@@ -832,7 +832,7 @@ void sbbs_t::privchat(bool local)
errormsg(WHERE,ERR_OPEN,str,O_RDWR|O_DENYNONE|O_CREAT);
return; }
if((p=(char *)MALLOC(PCHAT_LEN))==NULL) {
if((p=(char *)malloc(PCHAT_LEN))==NULL) {
close(in);
close(out);
errormsg(WHERE,ERR_ALLOC,str,PCHAT_LEN);
......@@ -840,7 +840,7 @@ void sbbs_t::privchat(bool local)
memset(p,0,PCHAT_LEN);
write(in,p,PCHAT_LEN);
write(out,p,PCHAT_LEN);
FREE(p);
free(p);
lseek(in,0L,SEEK_SET);
lseek(out,0L,SEEK_SET);
......@@ -1431,11 +1431,11 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
localtime_r(&now,&tm);
for(i=0;i<100;i++) {
if((answer[i]=(char *)MALLOC(512))==NULL) {
if((answer[i]=(char *)malloc(512))==NULL) {
errormsg(WHERE,ERR_ALLOC,nulstr,512);
while(i) {
i--;
FREE(answer[i]); }
free(answer[i]); }
sys_status&=~SS_GURUCHAT;
return; } }
ptr=gurubuf;
......@@ -1459,7 +1459,7 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
break; }
if(k<1) {
for(i=0;i<100;i++)
FREE(answer[i]);
free(answer[i]);
return; }
if(cstr[k+1]=='?')
k++;
......@@ -1682,7 +1682,7 @@ void sbbs_t::guruchat(char* line, char* gurubuf, int gurunum, char* last_answer)
hangup();
break; } }
for(i=0;i<100;i++)
FREE(answer[i]);
free(answer[i]);
}
/****************************************************************************/
......@@ -1711,7 +1711,7 @@ bool sbbs_t::guruexp(char **ptrptr, char *line)
ar=arstr(NULL,str,&cfg);
c=chk_ar(ar,&useron);
if(ar[0]!=AR_NULL)
FREE(ar);
free(ar);
if(!c && _and) {
result=false;
break; }
......
......@@ -147,7 +147,7 @@ void __fastcall TMainForm::FormShow(TObject *Sender)
return;
}
if((p=(char *)MALLOC(PCHAT_LEN))==NULL) {
if((p=(char *)malloc(PCHAT_LEN))==NULL) {
close(in);
close(out);
Remote->Lines->Add("!Error allocating memory");
......@@ -156,7 +156,7 @@ void __fastcall TMainForm::FormShow(TObject *Sender)
memset(p,0,PCHAT_LEN);
write(in,p,PCHAT_LEN);
write(out,p,PCHAT_LEN);
FREE(p);
free(p);
lseek(in,0L,SEEK_SET);
lseek(out,0L,SEEK_SET);
......
......@@ -239,7 +239,7 @@ int main(int argc, char **argv)
}
if((length/SHD_BLOCK_LEN)*sizeof(ulong)) {
if((number=(ulong *)MALLOC(((length/SHD_BLOCK_LEN)+2)*sizeof(ulong)))
if((number=(ulong *)malloc(((length/SHD_BLOCK_LEN)+2)*sizeof(ulong)))
==NULL) {
printf("Error allocating %lu bytes of memory\n"
,(length/SHD_BLOCK_LEN)*sizeof(ulong));
......@@ -662,11 +662,11 @@ int main(int argc, char **argv)
fprintf(stderr,"\nChecking %s Index\n\n",smb.file);
if((offset=(ulong *)MALLOC(total*sizeof(ulong)))==NULL) {
if((offset=(ulong *)malloc(total*sizeof(ulong)))==NULL) {
printf("Error allocating %lu bytes of memory\n",total*sizeof(ulong));
return(++errors);
}
if((number=(ulong *)MALLOC(total*sizeof(ulong)))==NULL) {
if((number=(ulong *)malloc(total*sizeof(ulong)))==NULL) {
printf("Error allocating %lu bytes of memory\n",total*sizeof(ulong));
return(++errors);
}
......
......@@ -84,7 +84,7 @@ void __fastcall TStatsLogForm::FormShow(TObject *Sender)
close(file);
return;
}
if((buf=(char *)MALLOC(length))==NULL) {
if((buf=(char *)malloc(length))==NULL) {
close(file);
sprintf(str,"!Error allocating %lu bytes",length);
Log->Lines->Add(AnsiString(str));
......
......@@ -21,7 +21,7 @@ void bail(int code)
exit(code);
}
long lputs(char FAR16 *str)
long lputs(char *str)
{
char tmp[256];
int i,j,k;
......@@ -63,7 +63,7 @@ int main(int argc, char **argv)
file_t workfile;
scfg_t cfg;
glob_t gl;
uchar HUGE16 *ixbbuf;
uchar *ixbbuf;
putenv("TZ=UCT0");
setvbuf(stdout,NULL,_IONBF,0);
......@@ -199,14 +199,14 @@ for(i=0;i<cfg.total_dirs;i++) {
if(!l) {
close(file);
continue; }
if((ixbbuf=(char *)MALLOC(l))==NULL) {
if((ixbbuf=(char *)malloc(l))==NULL) {
close(file);
printf("\7ERR_ALLOC %s %lu\n",str,l);
continue; }
if(read(file,ixbbuf,l)!=l) {
close(file);
printf("\7ERR_READ %s %lu\n",str,l);
FREE((char *)ixbbuf);
free((char *)ixbbuf);
continue; }
close(file);
......@@ -259,5 +259,5 @@ for(i=0;i<cfg.total_dirs;i++) {
if(!(misc&REPORT))
removefiledat(&cfg, &workfile); } }
FREE((char *)ixbbuf); }
free((char *)ixbbuf); }
}
......@@ -12,7 +12,7 @@ void bail(int code)
exit(code);
}
long lputs(char FAR16 *str)
long lputs(char *str)
{
char tmp[256];
int i,j,k;
......@@ -113,7 +113,7 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
if(argc>2)
end_lib=atoi(argv[2])-1;
if((fcrc=(ulong **)MALLOC(cfg.total_dirs*sizeof(ulong *)))==NULL) {
if((fcrc=(ulong **)malloc(cfg.total_dirs*sizeof(ulong *)))==NULL) {
printf("Not enough memory for CRCs.\r\n");
return(1); }
......@@ -121,27 +121,27 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
fprintf(stderr,"Reading directory index %u of %u\r",i+1,cfg.total_dirs);
sprintf(str,"%s%s.ixb",cfg.dir[i]->data_dir,cfg.dir[i]->code);
if((file=nopen(str,O_RDONLY|O_BINARY))==-1) {
fcrc[i]=(ulong *)MALLOC(1*sizeof(ulong));
fcrc[i]=(ulong *)malloc(1*sizeof(ulong));
fcrc[i][0]=0;
continue; }
l=filelength(file);
if(!l || (cfg.dir[i]->lib<start_lib || cfg.dir[i]->lib>end_lib)) {
close(file);
fcrc[i]=(ulong *)MALLOC(1*sizeof(ulong));
fcrc[i]=(ulong *)malloc(1*sizeof(ulong));
fcrc[i][0]=0;
continue; }
if((fcrc[i]=(ulong *)MALLOC((l/22+2)*sizeof(ulong)))==NULL) {
if((fcrc[i]=(ulong *)malloc((l/22+2)*sizeof(ulong)))==NULL) {
printf("Not enough memory for CRCs.\r\n");
return(1); }
fcrc[i][0]=(ulong)(l/22);
if((ixbbuf=(char *)MALLOC(l))==NULL) {
if((ixbbuf=(char *)malloc(l))==NULL) {
close(file);
printf("\7Error allocating memory for index %s.\r\n",str);
continue; }
if(read(file,ixbbuf,l)!=l) {
close(file);
printf("\7Error reading %s.\r\n",str);
FREE(ixbbuf);
free(ixbbuf);
continue; }
close(file);
j=1;
......@@ -151,7 +151,7 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
strupr(str);
fcrc[i][j++]=crc32(str,0);
m+=22; }
FREE(ixbbuf); }
free(ixbbuf); }
lputs("\n");
foundcrc=0L;
......@@ -172,7 +172,7 @@ fprintf(stderr,"\nDUPEFIND Version %s (%s) - Synchronet Duplicate File "
g=total_found+1; }
if(g==total_found) {
++total_found;
if((foundcrc=(ulong *)REALLOC(foundcrc
if((foundcrc=(ulong *)realloc(foundcrc
,total_found*sizeof(ulong)))==NULL) {
printf("Out of memory reallocating\r\n");
return(1); } }
......
......@@ -219,13 +219,13 @@ int main(int argc, char **argv)
read_echo_cfg();
// savnum=0;
if((opt=(char **)MALLOC(sizeof(char *)*300))==NULL) {
if((opt=(char **)malloc(sizeof(char *)*300))==NULL) {
uifc.bail();
puts("memory allocation error\n");
exit(1);
}
for(i=0;i<300;i++)
if((opt[i]=(char *)MALLOC(MAX_OPLN))==NULL) {
if((opt[i]=(char *)malloc(MAX_OPLN))==NULL) {
uifc.bail();
puts("memory allocation error\n");
exit(1);
......@@ -341,7 +341,7 @@ int main(int argc, char **argv)
,"Node Address (ALL wildcard allowed)",str
,25,K_EDIT)<1)
continue;
if((cfg.nodecfg=(nodecfg_t *)REALLOC(cfg.nodecfg
if((cfg.nodecfg=(nodecfg_t *)realloc(cfg.nodecfg
,sizeof(nodecfg_t)*(cfg.nodecfgs+1)))==NULL) {
printf("\nMemory Allocation Error\n");
exit(1); }
......@@ -362,7 +362,7 @@ int main(int argc, char **argv)
for(j=i;j<cfg.nodecfgs;j++)
memcpy(&cfg.nodecfg[j],&cfg.nodecfg[j+1]
,sizeof(nodecfg_t));
if((cfg.nodecfg=(nodecfg_t *)REALLOC(cfg.nodecfg
if((cfg.nodecfg=(nodecfg_t *)realloc(cfg.nodecfg
,sizeof(nodecfg_t)*(cfg.nodecfgs)))==NULL) {
printf("\nMemory Allocation Error\n");
exit(1); }
......@@ -503,7 +503,7 @@ int main(int argc, char **argv)
,K_EDIT|K_UPPER)<1)
continue;
if((cfg.nodecfg[i].flag=(flag_t *)
REALLOC(cfg.nodecfg[i].flag
realloc(cfg.nodecfg[i].flag
,sizeof(flag_t)*
(cfg.nodecfg[i].numflags+1)))==NULL) {
printf("\nMemory Allocation Error\n");
......@@ -528,7 +528,7 @@ int main(int argc, char **argv)
strcpy(cfg.nodecfg[i].flag[j].flag
,cfg.nodecfg[i].flag[j+1].flag);
if((cfg.nodecfg[i].flag=(flag_t *)
REALLOC(cfg.nodecfg[i].flag
realloc(cfg.nodecfg[i].flag
,sizeof(flag_t)*
(cfg.nodecfg[i].numflags)))==NULL) {
printf("\nMemory Allocation Error\n");
......@@ -857,7 +857,7 @@ int main(int argc, char **argv)
if(uifc.input(WIN_MID,0,0
,"Packer Name",str,25,K_EDIT|K_UPPER)<1)
continue;
if((cfg.arcdef=(arcdef_t *)REALLOC(cfg.arcdef
if((cfg.arcdef=(arcdef_t *)realloc(cfg.arcdef
,sizeof(arcdef_t)*(cfg.arcdefs+1)))==NULL) {
printf("\nMemory Allocation Error\n");
exit(1); }
......@@ -880,7 +880,7 @@ int main(int argc, char **argv)
for(j=i;j<cfg.arcdefs;j++)
memcpy(&cfg.arcdef[j],&cfg.arcdef[j+1]
,sizeof(arcdef_t));
if((cfg.arcdef=(arcdef_t *)REALLOC(cfg.arcdef
if((cfg.arcdef=(arcdef_t *)realloc(cfg.arcdef
,sizeof(arcdef_t)*(cfg.arcdefs)))==NULL) {
printf("\nMemory Allocation Error\n");
exit(1); }
......@@ -965,7 +965,7 @@ int main(int argc, char **argv)
if(uifc.input(WIN_MID|WIN_SAV,0,0
,"Echo List Path/Name",str,50,K_EDIT)<1)
continue;
if((cfg.listcfg=(echolist_t *)REALLOC(cfg.listcfg
if((cfg.listcfg=(echolist_t *)realloc(cfg.listcfg
,sizeof(echolist_t)*(cfg.listcfgs+1)))==NULL) {
printf("\nMemory Allocation Error\n");
exit(1); }
......@@ -986,7 +986,7 @@ int main(int argc, char **argv)
for(j=i;j<cfg.listcfgs;j++)
memcpy(&cfg.listcfg[j],&cfg.listcfg[j+1]
,sizeof(echolist_t));
if((cfg.listcfg=(echolist_t *)REALLOC(cfg.listcfg
if((cfg.listcfg=(echolist_t *)realloc(cfg.listcfg
,sizeof(echolist_t)*(cfg.listcfgs)))==NULL) {
printf("\nMemory Allocation Error\n");
exit(1); }
......@@ -1075,7 +1075,7 @@ int main(int argc, char **argv)
,K_EDIT|K_UPPER)<1)
continue;
if((cfg.listcfg[i].flag=(flag_t *)
REALLOC(cfg.listcfg[i].flag
realloc(cfg.listcfg[i].flag
,sizeof(flag_t)*
(cfg.listcfg[i].numflags+1)))==NULL) {
printf("\nMemory Allocation Error\n");
......@@ -1100,7 +1100,7 @@ int main(int argc, char **argv)
strcpy(cfg.listcfg[i].flag[j].flag
,cfg.listcfg[i].flag[j+1].flag);
if((cfg.listcfg[i].flag=(flag_t *)
REALLOC(cfg.listcfg[i].flag
realloc(cfg.listcfg[i].flag
,sizeof(flag_t)*
(cfg.listcfg[i].numflags)))==NULL) {
printf("\nMemory Allocation Error\n");
......
......@@ -475,15 +475,15 @@ void sbbs_t::freevars(csi_t *bin)
if(bin->str_var) {
for(i=0;i<bin->str_vars;i++)
if(bin->str_var[i])
FREE(bin->str_var[i]);
FREE(bin->str_var);
free(bin->str_var[i]);
free(bin->str_var);
}
if(bin->int_var)
FREE(bin->int_var);
free(bin->int_var);
if(bin->str_var_name)
FREE(bin->str_var_name);
free(bin->str_var_name);
if(bin->int_var_name)
FREE(bin->int_var_name);
free(bin->int_var_name);
for(i=0;i<bin->files;i++) {
if(bin->file[i]) {
fclose((FILE *)bin->file[i]);
......@@ -513,7 +513,7 @@ char * sbbs_t::copystrvar(csi_t *csi, char *p, char *str)
if(p==sysvar_p[i])
break;
if(!p || i==MAX_SYSVARS) { /* Not system variable */
if((np=(char*)REALLOC(p,strlen(str)+1))==NULL)
if((np=(char*)realloc(p,strlen(str)+1))==NULL)
errormsg(WHERE,ERR_ALLOC,"variable",strlen(str)+1);
else
p=np; } }
......@@ -687,7 +687,7 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
}
bin.length=filelength(file);
if((bin.cs=(uchar *)MALLOC(bin.length))==NULL) {
if((bin.cs=(uchar *)malloc(bin.length))==NULL) {
close(file);
errormsg(WHERE,ERR_ALLOC,str,bin.length);
return(-1);
......@@ -695,7 +695,7 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
if(lread(file,bin.cs,bin.length)!=bin.length) {
close(file);
errormsg(WHERE,ERR_READ,str,bin.length);
FREE(bin.cs);
free(bin.cs);
return(-1);
}
close(file);
......@@ -713,7 +713,7 @@ long sbbs_t::exec_bin(char *mod, csi_t *csi)
}
freevars(&bin);
FREE(bin.cs);
free(bin.cs);