fix for random linux crashes (from spike)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@552 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Hexum 2004-12-04 16:26:22 +00:00
parent b628d14df0
commit ab41bbb0a7

View file

@ -55,7 +55,7 @@ void Plug_RegisterBuiltin(char *name, Plug_Builtin_t bi, int flags)
while(newnum < numplugbuiltins && plugbuiltins[newnum].func) while(newnum < numplugbuiltins && plugbuiltins[newnum].func)
newnum+=128; newnum+=128;
if (newnum > numplugbuiltins) if (newnum >= numplugbuiltins)
{ {
numplugbuiltins = newnum+128; numplugbuiltins = newnum+128;
plugbuiltins = BZ_Realloc(plugbuiltins, sizeof(Plug_Plugins_t)*numplugbuiltins); plugbuiltins = BZ_Realloc(plugbuiltins, sizeof(Plug_Plugins_t)*numplugbuiltins);
@ -78,7 +78,7 @@ static void Plug_RegisterBuiltinIndex(char *name, Plug_Builtin_t bi, int flags,
newnum++; newnum++;
if (newnum > numplugbuiltins) if (newnum >= numplugbuiltins)
{ {
numplugbuiltins = newnum+128; numplugbuiltins = newnum+128;
plugbuiltins = BZ_Realloc(plugbuiltins, sizeof(Plug_Plugins_t)*numplugbuiltins); plugbuiltins = BZ_Realloc(plugbuiltins, sizeof(Plug_Plugins_t)*numplugbuiltins);