mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-04 23:41:34 +00:00
Dynamically allocate space for a state's action field
It was previously restricted arbitrarily to 32 cells (31 usable characters) due to someone else's laziness
This commit is contained in:
parent
1355a82aa5
commit
691b17a88e
1 changed files with 6 additions and 4 deletions
|
@ -2776,13 +2776,13 @@ void readframe(MYFILE *f, INT32 num)
|
||||||
{
|
{
|
||||||
size_t z;
|
size_t z;
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
char actiontocompare[32];
|
size_t actionlen = strlen(word2) + 1;
|
||||||
|
char *actiontocompare = calloc(actionlen, 1);
|
||||||
|
|
||||||
memset(actiontocompare, 0x00, sizeof(actiontocompare));
|
strcpy(actiontocompare, word2);
|
||||||
strlcpy(actiontocompare, word2, sizeof (actiontocompare));
|
|
||||||
strupr(actiontocompare);
|
strupr(actiontocompare);
|
||||||
|
|
||||||
for (z = 0; z < 32; z++)
|
for (z = 0; z < actionlen; z++)
|
||||||
{
|
{
|
||||||
if (actiontocompare[z] == '\n' || actiontocompare[z] == '\r')
|
if (actiontocompare[z] == '\n' || actiontocompare[z] == '\r')
|
||||||
{
|
{
|
||||||
|
@ -2815,6 +2815,8 @@ void readframe(MYFILE *f, INT32 num)
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
deh_warning("Unknown action %s", actiontocompare);
|
deh_warning("Unknown action %s", actiontocompare);
|
||||||
|
|
||||||
|
free(actiontocompare);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
deh_warning("Frame %d: unknown word '%s'", num, word1);
|
deh_warning("Frame %d: unknown word '%s'", num, word1);
|
||||||
|
|
Loading…
Reference in a new issue