Misc cleanups

git-svn-id: https://svn.eduke32.com/eduke32@232 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-07-21 22:25:05 +00:00
parent c4cd9ca1ef
commit d33bcb97a8
2 changed files with 484 additions and 591 deletions

File diff suppressed because it is too large Load diff

View file

@ -358,10 +358,10 @@ void adduserquote(char *daquote)
for(i=MAXUSERQUOTES-1;i>0;i--) for(i=MAXUSERQUOTES-1;i>0;i--)
{ {
strcpy(user_quote[i],user_quote[i-1]); Bstrcpy(user_quote[i],user_quote[i-1]);
user_quote_time[i] = user_quote_time[i-1]; user_quote_time[i] = user_quote_time[i-1];
} }
strcpy(user_quote[0],daquote); Bstrcpy(user_quote[0],daquote);
OSD_Printf("%s\n",strip_color_codes(daquote)); OSD_Printf("%s\n",strip_color_codes(daquote));
user_quote_time[0] = ud.msgdisptime; user_quote_time[0] = ud.msgdisptime;
@ -450,7 +450,7 @@ if( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); }
sendpacket(i,packbuf,packbufleng); sendpacket(i,packbuf,packbufleng);
} }
strcpy(boardfilename,packbuf+1); Bstrcpy(boardfilename,packbuf+1);
boardfilename[packbufleng-1] = 0; boardfilename[packbufleng-1] = 0;
if(boardfilename[0] != 0) if(boardfilename[0] != 0)
{ {
@ -653,7 +653,7 @@ if( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); }
} }
} }
strcpy(recbuf,packbuf+2); Bstrcpy(recbuf,packbuf+2);
recbuf[packbufleng-2] = 0; recbuf[packbufleng-2] = 0;
adduserquote(recbuf); adduserquote(recbuf);
@ -1605,7 +1605,7 @@ void digitalnumber(long x,long y,long n,char s,char cs)
//ltoa(n,b,10); //ltoa(n,b,10);
Bsnprintf(b,10,"%ld",n); Bsnprintf(b,10,"%ld",n);
i = strlen(b); i = Bstrlen(b);
j = 0; j = 0;
for(k=0;k<i;k++) for(k=0;k<i;k++)
@ -1631,7 +1631,7 @@ void txdigitalnumber(short starttile, long x,long y,long n,char s,char pal,char
//ltoa(n,b,10); //ltoa(n,b,10);
Bsnprintf(b,10,"%ld",n); Bsnprintf(b,10,"%ld",n);
i = strlen(b); i = Bstrlen(b);
j = 0; j = 0;
for(k=0;k<i;k++) for(k=0;k<i;k++)
@ -2368,7 +2368,7 @@ void typemode(void)
if(typebuf[0] == '/' && Btoupper(typebuf[1]) == 'M' && Btoupper(typebuf[2]) == 'E') if(typebuf[0] == '/' && Btoupper(typebuf[1]) == 'M' && Btoupper(typebuf[2]) == 'E')
{ {
strcat(recbuf,"* "); Bstrcat(recbuf,"* ");
i = 3, j = Bstrlen(typebuf); i = 3, j = Bstrlen(typebuf);
Bstrcpy(tempbuf,typebuf); Bstrcpy(tempbuf,typebuf);
while(i < j) while(i < j)
@ -2377,19 +2377,19 @@ void typemode(void)
i++; i++;
} }
typebuf[i-3] = '\0'; typebuf[i-3] = '\0';
strcat(recbuf,ud.user_name[myconnectindex]); Bstrcat(recbuf,ud.user_name[myconnectindex]);
} }
else else
{ {
strcat(recbuf,ud.user_name[myconnectindex]); Bstrcat(recbuf,ud.user_name[myconnectindex]);
strcat(recbuf,": "); Bstrcat(recbuf,": ");
} }
strcat(recbuf,"^0"); Bstrcat(recbuf,"^0");
strcat(recbuf,typebuf); Bstrcat(recbuf,typebuf);
j = strlen(recbuf); j = Bstrlen(recbuf);
recbuf[j] = 0; recbuf[j] = 0;
strcat(tempbuf+2,recbuf); Bstrcat(tempbuf+2,recbuf);
if(sendmessagecommand >= ud.multimode || movesperpacket == 4) if(sendmessagecommand >= ud.multimode || movesperpacket == 4)
{ {
@ -6565,8 +6565,8 @@ void cheats(void)
return; return;
if (VOLUMEONE && !z) { if (VOLUMEONE && !z) {
strcpy(cheatquotes[2],"scotty##"); Bstrcpy(cheatquotes[2],"scotty##");
strcpy(cheatquotes[6],"<RESERVED>"); Bstrcpy(cheatquotes[6],"<RESERVED>");
z=1; z=1;
} }
@ -6856,7 +6856,7 @@ FOUNDCHEAT:
case CHEAT_SKILL: case CHEAT_SKILL:
if(k == CHEAT_SCOTTY) if(k == CHEAT_SCOTTY)
{ {
i = strlen(cheatquotes[k])-3+VOLUMEONE; i = Bstrlen(cheatquotes[k])-3+VOLUMEONE;
if (!consolecheat) { // JBF 20030914 if (!consolecheat) { // JBF 20030914
short volnume,levnume; short volnume,levnume;
if (VOLUMEALL) { if (VOLUMEALL) {
@ -6911,7 +6911,7 @@ FOUNDCHEAT:
} }
else else
{ {
i = strlen(cheatquotes[k])-1; i = Bstrlen(cheatquotes[k])-1;
ud.m_player_skill = ud.player_skill = cheatbuf[i] - '1'; ud.m_player_skill = ud.player_skill = cheatbuf[i] - '1';
} }
if(numplayers > 1 && myconnectindex == connecthead) if(numplayers > 1 && myconnectindex == connecthead)
@ -7244,7 +7244,7 @@ void nonsharedkeys(void)
tempbuf[ch] = 4; tempbuf[ch] = 4;
tempbuf[ch+1] = 255; tempbuf[ch+1] = 255;
tempbuf[ch+2] = 0; tempbuf[ch+2] = 0;
strcat(tempbuf+2,ud.ridecule[i-1]); Bstrcat(tempbuf+2,ud.ridecule[i-1]);
i = 2+strlen(ud.ridecule[i-1]); i = 2+strlen(ud.ridecule[i-1]);
@ -7423,7 +7423,7 @@ FAKE_F3:
screencapt = 0; screencapt = 0;
if( lastsavedpos >= 0 ) if( lastsavedpos >= 0 )
{ {
/* inputloc = strlen(&ud.savegame[lastsavedpos][0]); /* inputloc = Bstrlen(&ud.savegame[lastsavedpos][0]);
current_menu = 360+lastsavedpos; current_menu = 360+lastsavedpos;
probey = lastsavedpos; */ probey = lastsavedpos; */
if(ud.multimode > 1) if(ud.multimode > 1)
@ -7930,7 +7930,7 @@ void checkcommandline(int argc,char **argv)
c++; c++;
if(*c) if(*c)
{ {
strcpy(confilename,c); Bstrcpy(confilename,c);
userconfiles = 1; userconfiles = 1;
/* if(SafeFileExists(c) == 0) /* if(SafeFileExists(c) == 0)
{ {
@ -7945,9 +7945,9 @@ void checkcommandline(int argc,char **argv)
c++; c++;
if(*c) if(*c)
{ {
strcpy(tempbuf,c); Bstrcpy(tempbuf,c);
if( strchr(tempbuf,'.') == 0) if( strchr(tempbuf,'.') == 0)
strcat(tempbuf,".grp"); Bstrcat(tempbuf,".grp");
j = initgroupfile(tempbuf); j = initgroupfile(tempbuf);
if( j == -1 ) if( j == -1 )
@ -8100,9 +8100,9 @@ void checkcommandline(int argc,char **argv)
case 'D': case 'D':
c++; c++;
if( strchr(c,'.') == 0) if( strchr(c,'.') == 0)
strcat(c,".dmo"); Bstrcat(c,".dmo");
initprintf("Play demo %s.\n",c); initprintf("Play demo %s.\n",c);
strcpy(firstdemofile,c); Bstrcpy(firstdemofile,c);
break; break;
case 'l': case 'l':
case 'L': case 'L':
@ -8685,9 +8685,9 @@ void sendboardname(void)
tempbuf[0] = 9; tempbuf[0] = 9;
tempbuf[1] = 0; tempbuf[1] = 0;
j = strlen(boardfilename); j = Bstrlen(boardfilename);
boardfilename[j] = 0; boardfilename[j] = 0;
strcat(tempbuf+1,boardfilename); Bstrcat(tempbuf+1,boardfilename);
for(ch=connecthead;ch >= 0;ch=connectpoint2[ch]) for(ch=connecthead;ch >= 0;ch=connectpoint2[ch])
{ {
@ -9201,7 +9201,7 @@ char opendemoread(char which_demo) // 0 = mine
char ver; char ver;
int32 i; int32 i;
strcpy(d, "demo_.dmo"); Bstrcpy(d, "demo_.dmo");
if(which_demo == 10) if(which_demo == 10)
d[4] = 'x'; d[4] = 'x';