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);
if (com_token[0] == '}')
break;
- strcpy (keyname, com_token);
+ strlcpy (keyname, com_token, sizeof(keyname));
// parse value
if (!COM_ParseTokenConsole(&data))
// 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);
if (anglehack)
{
char temp[32];
- strcpy (temp, com_token);
+ strlcpy (temp, com_token, sizeof(temp));
sprintf (com_token, "0 %s 0", temp);
}
if (prog->progs == NULL || filesize < (fs_offset_t)sizeof(dprograms_t))
PRVM_ERROR ("PRVM_LoadProgs: couldn't load %s for %s", filename, PRVM_NAME);
- Con_DPrintf("%s programs occupy %iK.\n", PRVM_NAME, filesize/1024);
+ Con_DPrintf("%s programs occupy %iK.\n", PRVM_NAME, (int)(filesize/1024));
prog->filecrc = CRC_Block((unsigned char *)prog->progs, filesize);
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);