Expanded the maximum length of frame macro names to 64-1 characters as per LordHavoc's patch. Also added a message when a frame macro name is too long.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2861 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
4dcbbf5054
commit
67f89fa7f0
1 changed files with 11 additions and 6 deletions
|
@ -1527,7 +1527,7 @@ void QCC_PR_LexWhitespace (void)
|
||||||
|
|
||||||
#define MAX_FRAMES 8192
|
#define MAX_FRAMES 8192
|
||||||
char pr_framemodelname[64];
|
char pr_framemodelname[64];
|
||||||
char pr_framemacros[MAX_FRAMES][16];
|
char pr_framemacros[MAX_FRAMES][64];
|
||||||
int pr_framemacrovalue[MAX_FRAMES];
|
int pr_framemacrovalue[MAX_FRAMES];
|
||||||
int pr_nummacros, pr_oldmacros;
|
int pr_nummacros, pr_oldmacros;
|
||||||
int pr_macrovalue;
|
int pr_macrovalue;
|
||||||
|
@ -1627,11 +1627,16 @@ void QCC_PR_MacroFrame(char *name, int value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strlen(name)+1 > sizeof(pr_framemacros[0]))
|
||||||
|
QCC_PR_ParseWarning(ERR_TOOMANYFRAMEMACROS, "Name for frame macro %s is too long", name);
|
||||||
|
else
|
||||||
|
{
|
||||||
strcpy (pr_framemacros[pr_nummacros], name);
|
strcpy (pr_framemacros[pr_nummacros], name);
|
||||||
pr_framemacrovalue[pr_nummacros] = value;
|
pr_framemacrovalue[pr_nummacros] = value;
|
||||||
pr_nummacros++;
|
pr_nummacros++;
|
||||||
if (pr_nummacros >= MAX_FRAMES)
|
if (pr_nummacros >= MAX_FRAMES)
|
||||||
QCC_PR_ParseError(ERR_TOOMANYFRAMEMACROS, "Too many frame macros defined");
|
QCC_PR_ParseError(ERR_TOOMANYFRAMEMACROS, "Too many frame macros defined");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCC_PR_ParseFrame (void)
|
void QCC_PR_ParseFrame (void)
|
||||||
|
|
Loading…
Reference in a new issue