sprintf (line, "pointer");
break;
default:
- sprintf (line, "bad type %i", type);
+ sprintf (line, "bad type %i", (int) type);
break;
}
tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
- strcat(tempstring, name);
+ strlcat(tempstring, name, sizeof(tempstring));
for (l = strlen(name);l < 14;l++)
- strcat(tempstring, " ");
- strcat(tempstring, " ");
+ strlcat(tempstring, " ", sizeof(tempstring));
+ strlcat(tempstring, " ", sizeof(tempstring));
name = PRVM_ValueString((etype_t)d->type, (prvm_eval_t *)v);
if (strlen(name) > sizeof(tempstring2)-4)
tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
- strcat(tempstring, name);
- strcat(tempstring, "\n");
+ strlcat(tempstring, name, sizeof(tempstring));
+ strlcat(tempstring, "\n", sizeof(tempstring));
if (strlen(tempstring) >= sizeof(tempstring)/2)
{
Con_Print(tempstring);
while (1)
{
// parse key
- if (!COM_ParseToken(&data, false))
+ if (!COM_ParseTokenConsole(&data))
PRVM_ERROR ("PRVM_ED_ParseGlobals: EOF without closing brace");
if (com_token[0] == '}')
break;
- strcpy (keyname, com_token);
+ strlcpy (keyname, com_token, sizeof(keyname));
// parse value
- if (!COM_ParseToken(&data, false))
+ if (!COM_ParseTokenConsole(&data))
PRVM_ERROR ("PRVM_ED_ParseGlobals: EOF without closing brace");
if (com_token[0] == '}')
while (1)
{
// parse key
- if (!COM_ParseToken(&data, false))
+ if (!COM_ParseTokenConsole(&data))
PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
if (developer_entityparsing.integer)
Con_Printf("Key: \"%s\"", com_token);
// and allow them to be turned into vectors. (FIXME...)
if (!strcmp(com_token, "angle"))
{
- strcpy (com_token, "angles");
+ strlcpy (com_token, "angles", sizeof(com_token));
anglehack = true;
}
else
// FIXME: change light to _light to get rid of this hack
if (!strcmp(com_token, "light"))
- strcpy (com_token, "light_lev"); // hack for single light def
+ strlcpy (com_token, "light_lev", sizeof(com_token)); // hack for single light def
- strcpy (keyname, com_token);
+ strlcpy (keyname, com_token, sizeof(keyname));
// another hack to fix keynames with trailing spaces
n = strlen(keyname);
}
// parse value
- if (!COM_ParseToken(&data, false))
+ if (!COM_ParseTokenConsole(&data))
PRVM_ERROR ("PRVM_ED_ParseEdict: EOF without closing brace");
if (developer_entityparsing.integer)
Con_Printf(" \"%s\"\n", com_token);
if (anglehack)
{
char temp[32];
- strcpy (temp, com_token);
+ strlcpy (temp, com_token, sizeof(temp));
sprintf (com_token, "0 %s 0", temp);
}
while (1)
{
// parse the opening brace
- if (!COM_ParseToken(&data, false))
+ if (!COM_ParseTokenConsole(&data))
break;
if (com_token[0] != '{')
PRVM_ERROR ("PRVM_ED_LoadFromFile: %s: found %s when expecting {", PRVM_NAME, com_token);
switch(d->type & ~DEF_SAVEGLOBAL)
{
case ev_string:
- strcat(tempstring, "string ");
+ strlcat(tempstring, "string ", sizeof(tempstring));
break;
case ev_entity:
- strcat(tempstring, "entity ");
+ strlcat(tempstring, "entity ", sizeof(tempstring));
break;
case ev_function:
- strcat(tempstring, "function ");
+ strlcat(tempstring, "function ", sizeof(tempstring));
break;
case ev_field:
- strcat(tempstring, "field ");
+ strlcat(tempstring, "field ", sizeof(tempstring));
break;
case ev_void:
- strcat(tempstring, "void ");
+ strlcat(tempstring, "void ", sizeof(tempstring));
break;
case ev_float:
- strcat(tempstring, "float ");
+ strlcat(tempstring, "float ", sizeof(tempstring));
break;
case ev_vector:
- strcat(tempstring, "vector ");
+ strlcat(tempstring, "vector ", sizeof(tempstring));
break;
case ev_pointer:
- strcat(tempstring, "pointer ");
+ strlcat(tempstring, "pointer ", sizeof(tempstring));
break;
default:
sprintf (tempstring2, "bad type %i ", d->type & ~DEF_SAVEGLOBAL);
- strcat(tempstring, tempstring2);
+ strlcat(tempstring, tempstring2, sizeof(tempstring));
break;
}
if (strlen(name) > sizeof(tempstring2)-4)
tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
- strcat(tempstring, name);
+ strlcat(tempstring, name, sizeof(tempstring));
for (j = (int)strlen(name);j < 25;j++)
- strcat(tempstring, " ");
+ strlcat(tempstring, " ", sizeof(tempstring));
sprintf(tempstring2, "%5d", counts[i]);
- strcat(tempstring, tempstring2);
- strcat(tempstring, "\n");
+ strlcat(tempstring, tempstring2, sizeof(tempstring));
+ strlcat(tempstring, "\n", sizeof(tempstring));
if (strlen(tempstring) >= sizeof(tempstring)/2)
{
Con_Print(tempstring);