//int NoCrash_NUM_FOR_EDICT(prvm_edict_t *e);
char *PR_ValueString (etype_t type, prvm_eval_t *val)
{
- static char line[1024]; // LordHavoc: enlarged a bit (was 256)
+ static char line[MAX_INPUTLINE];
ddef_t *def;
mfunction_t *f;
int n;
*/
char *PR_UglyValueString (etype_t type, prvm_eval_t *val)
{
- static char line[4096];
+ static char line[MAX_INPUTLINE];
int i;
const char *s;
ddef_t *def;
int i, j;
const char *name;
int type;
- char tempstring[8192], tempstring2[260]; // temporary string buffers
+ char tempstring[MAX_INPUTLINE], tempstring2[260]; // temporary string buffers
if (ed->priv.server->free)
{
if (j == type_size[type])
continue;
- if (strlen(name) > 256)
+ if (strlen(name) > sizeof(tempstring2)-4)
{
- memcpy (tempstring2, name, 256);
- tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
- tempstring2[259] = 0;
+ memcpy (tempstring2, name, sizeof(tempstring2)-4);
+ tempstring2[sizeof(tempstring2)-4] = tempstring2[sizeof(tempstring2)-3] = tempstring2[sizeof(tempstring2)-2] = '.';
+ tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
strlcat (tempstring, name, sizeof (tempstring));
strcat(tempstring, " ");
name = PR_ValueString(d->type, (prvm_eval_t *)v);
- if (strlen(name) > 256)
+ if (strlen(name) > sizeof(tempstring2)-4)
{
- memcpy(tempstring2, name, 256);
- tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
- tempstring2[259] = 0;
+ memcpy (tempstring2, name, sizeof(tempstring2)-4);
+ tempstring2[sizeof(tempstring2)-4] = tempstring2[sizeof(tempstring2)-3] = tempstring2[sizeof(tempstring2)-2] = '.';
+ tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
strlcat (tempstring, name, sizeof (tempstring));
strlcat (tempstring, "\n", sizeof (tempstring));
- if (strlen(tempstring) >= 4096)
+ if (strlen(tempstring) >= sizeof(tempstring)/2)
{
Con_Print(tempstring);
tempstring[0] = 0;
*/
void ED_ParseGlobals (const char *data)
{
- char keyname[1024]; // LordHavoc: good idea? bad idea? was 64
+ char keyname[MAX_INPUTLINE];
ddef_t *key;
while (1)
int i, j, ednum, used, usedamount;
int *counts;
const char *name;
- char tempstring[5000], tempstring2[260];
+ char tempstring[MAX_INPUTLINE], tempstring2[260];
prvm_edict_t *ed;
ddef_t *d;
int *v;
strlcat (tempstring, tempstring2, sizeof (tempstring));
break;
}
- if (strlen(name) > 256)
+ if (strlen(name) > sizeof(tempstring2)-4)
{
- memcpy(tempstring2, name, 256);
- tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
- tempstring2[259] = 0;
+ memcpy (tempstring2, name, sizeof(tempstring2)-4);
+ tempstring2[sizeof(tempstring2)-4] = tempstring2[sizeof(tempstring2)-3] = tempstring2[sizeof(tempstring2)-2] = '.';
+ tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
strcat (tempstring, name);
dpsnprintf (tempstring2, sizeof (tempstring2), "%5d", counts[i]);
strlcat (tempstring, tempstring2, sizeof (tempstring));
strlcat (tempstring, "\n", sizeof (tempstring));
- if (strlen(tempstring) >= 4096)
+ if (strlen(tempstring) >= sizeof(tempstring)/2)
{
Con_Print(tempstring);
tempstring[0] = 0;