Define a MAXQUOTELEN as 64 and use that instead of specific limits

git-svn-id: https://svn.eduke32.com/eduke32@93 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-04-23 02:30:33 +00:00
parent 8d6f8eecda
commit 62f08cabe9
3 changed files with 10 additions and 8 deletions

View File

@ -431,6 +431,8 @@ extern short int global_random;
extern long scaredfallz;
extern char buf[1024]; //My own generic input buffer
#define MAXQUOTELEN 64
extern char *fta_quotes[NUMOFFIRSTTIMEACTIVE];
extern char scantoasc[128],ready2send;
extern char scantoascwithshift[128];

View File

@ -4541,7 +4541,7 @@ repeatcase:
if (tw == CON_DEFINEQUOTE)
{
if(fta_quotes[k] == NULL)
fta_quotes[k] = Bmalloc(sizeof(char) * 64);
fta_quotes[k] = Bmalloc(sizeof(char) * MAXQUOTELEN);
scriptptr--;
}
@ -4554,7 +4554,7 @@ repeatcase:
{
redefined_quote_count++;
if(redefined_quotes[redefined_quote_count] == NULL)
redefined_quotes[redefined_quote_count] = Bmalloc(sizeof(char) * 64);
redefined_quotes[redefined_quote_count] = Bmalloc(sizeof(char) * MAXQUOTELEN);
}
while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 )
@ -4571,9 +4571,9 @@ repeatcase:
else
*(redefined_quotes[redefined_quote_count]+i) = *textptr;
textptr++,i++;
if(i >= 63)
if(i >= MAXQUOTELEN-1)
{
initprintf("%s:%ld: error: quote text exceeds limit of %ld characters.\n",compilefile,line_number,63);
initprintf("%s:%ld: error: quote text exceeds limit of %ld characters.\n",compilefile,line_number,MAXQUOTELEN-1);
error++;
while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++;
break;

View File

@ -4113,10 +4113,10 @@ SKIPJIBS:
Bsprintf(fta_quotes[i],"%d",j);
break;
case CON_QSTRCAT:
Bmemcpy(tempbuf,fta_quotes[i],64);
Bmemcpy(buf,fta_quotes[j],64);
Bstrncat(tempbuf,buf,63-Bstrlen(tempbuf));
Bmemcpy(fta_quotes[i],tempbuf,64);
Bmemcpy(tempbuf,fta_quotes[i],MAXQUOTELEN);
Bmemcpy(buf,fta_quotes[j],MAXQUOTELEN);
Bstrncat(tempbuf,buf,(MAXQUOTELEN-1)-Bstrlen(tempbuf));
Bmemcpy(fta_quotes[i],tempbuf,MAXQUOTELEN);
break;
case CON_QSTRCPY:
Bstrcpy(fta_quotes[j],fta_quotes[i]);