switch (type)
{
case ev_string:
- sprintf (line, "%s", PRVM_GetString(val->string));
+ strncpy(line, PRVM_GetString(val->string), sizeof(line));
break;
case ev_entity:
n = val->edict;
break;
case ev_function:
f = pr_functions + val->function;
- snprintf (line, sizeof (line), "%s", PRVM_GetString(f->s_name));
+ strncpy(line, PRVM_GetString(f->s_name), sizeof(line));
break;
case ev_field:
def = PRVM_ED_FieldAtOfs ( val->_int );
*/
// LordHavoc: optimized this to print out much more quickly (tempstring)
// LordHavoc: changed to print out every 4096 characters (incase there are a lot of fields to print)
-void PRVM_ED_Print (prvm_edict_t *ed)
+void PRVM_ED_Print(prvm_edict_t *ed)
{
int l;
ddef_t *d;
if (ed->e->free)
{
- Con_Printf ("%s: FREE\n",PRVM_NAME);
+ Con_Printf("%s: FREE\n",PRVM_NAME);
return;
}
strcat(tempstring, "\n");
if (strlen(tempstring) >= 4096)
{
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
tempstring[0] = 0;
}
}
if (tempstring[0])
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
}
/*
char *name;
int type;
- FS_Printf (f, "{\n");
+ FS_Print(f, "{\n");
if (ed->e->free)
{
- FS_Printf (f, "}\n");
+ FS_Print(f, "}\n");
return;
}
if (j == prvm_type_size[type])
continue;
- FS_Printf (f,"\"%s\" ",name);
- FS_Printf (f,"\"%s\"\n", PRVM_UglyValueString(d->type, (prvm_eval_t *)v));
+ FS_Printf(f,"\"%s\" ",name);
+ FS_Printf(f,"\"%s\"\n", PRVM_UglyValueString(d->type, (prvm_eval_t *)v));
}
- FS_Printf (f, "}\n");
+ FS_Print(f, "}\n");
}
void PRVM_ED_PrintNum (int ent)
{
- PRVM_ED_Print (PRVM_EDICT_NUM(ent));
+ PRVM_ED_Print(PRVM_EDICT_NUM(ent));
}
/*
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_edicts <program name>\n");
+ Con_Print("prvm_edicts <program name>\n");
return;
}
if(!PRVM_SetProgFromString(Cmd_Argv(1)))
return;
- Con_Printf ("%s: %i entities\n", PRVM_NAME, prog->num_edicts);
+ Con_Printf("%s: %i entities\n", PRVM_NAME, prog->num_edicts);
for (i=0 ; i<prog->num_edicts ; i++)
PRVM_ED_PrintNum (i);
if(Cmd_Argc() != 3)
{
- Con_Printf("prvm_edict <program name> <edict number>\n");
+ Con_Print("prvm_edict <program name> <edict number>\n");
return;
}
i = atoi (Cmd_Argv(2));
if (i >= prog->num_edicts)
{
- Con_Printf("Bad edict number\n");
+ Con_Print("Bad edict number\n");
PRVM_End;
return;
}
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_count <program name>\n");
+ Con_Print("prvm_count <program name>\n");
return;
}
active++;
}
- Con_Printf ("num_edicts:%3i\n", prog->num_edicts);
- Con_Printf ("active :%3i\n", active);
+ Con_Printf("num_edicts:%3i\n", prog->num_edicts);
+ Con_Printf("active :%3i\n", active);
}
PRVM_End;
char *name;
int type;
- FS_Printf (f,"{\n");
+ FS_Print(f,"{\n");
for (i=0 ; i<prog->progs->numglobaldefs ; i++)
{
def = &prog->globaldefs[i];
continue;
name = PRVM_GetString(def->s_name);
- FS_Printf (f,"\"%s\" ", name);
- FS_Printf (f,"\"%s\"\n", PRVM_UglyValueString(type, (prvm_eval_t *)&prog->globals[def->ofs]));
+ FS_Printf(f,"\"%s\" ", name);
+ FS_Printf(f,"\"%s\"\n", PRVM_UglyValueString(type, (prvm_eval_t *)&prog->globals[def->ofs]));
}
- FS_Printf (f,"}\n");
+ FS_Print(f,"}\n");
}
/*
key = PRVM_ED_FindGlobal (keyname);
if (!key)
{
- Con_DPrintf ("'%s' is not a global on %s\n", keyname, PRVM_NAME);
+ Con_DPrintf("'%s' is not a global on %s\n", keyname, PRVM_NAME);
continue;
}
func = PRVM_ED_FindFunction(s);
if (!func)
{
- Con_Printf ("PRVM_ED_ParseEpair: Can't find function %s in %s\n", s, PRVM_NAME);
+ Con_Printf("PRVM_ED_ParseEpair: Can't find function %s in %s\n", s, PRVM_NAME);
return false;
}
val->function = func - prog->functions;
if(Cmd_Argc() != 5)
{
- Con_Printf("prvm_edictset <program name> <edict number> <field> <value>\n");
+ Con_Print("prvm_edictset <program name> <edict number> <field> <value>\n");
return;
}
key = PRVM_ED_FindField (keyname);
if (!key)
{
- Con_DPrintf ("%s: '%s' is not a field\n", PRVM_NAME, keyname);
+ Con_DPrintf("%s: '%s' is not a field\n", PRVM_NAME, keyname);
continue;
}
string_t handle = *(string_t*)&((float*)ent->v)[PRVM_ED_FindFieldOffset("classname")];
if (!handle)
{
- Con_Printf ("No classname for:\n");
- PRVM_ED_Print (ent);
+ Con_Print("No classname for:\n");
+ PRVM_ED_Print(ent);
PRVM_ED_Free (ent);
continue;
}
{
if (developer.integer) // don't confuse non-developers with errors
{
- Con_Printf ("No spawn function for:\n");
- PRVM_ED_Print (ent);
+ Con_Print("No spawn function for:\n");
+ PRVM_ED_Print(ent);
}
PRVM_ED_Free (ent);
continue;
died++;
}
- Con_DPrintf ("%s: %i new entities parsed, %i new inhibited, %i (%i new) spawned (whereas %i removed self, %i stayed)\n", PRVM_NAME, parsed, inhibited, prog->num_edicts, spawned, died, spawned - died);
+ Con_DPrintf("%s: %i new entities parsed, %i new inhibited, %i (%i new) spawned (whereas %i removed self, %i stayed)\n", PRVM_NAME, parsed, inhibited, prog->num_edicts, spawned, died, spawned - died);
}
// not used
memcpy(prog->progs, temp, fs_filesize);
Mem_Free(temp);
- Con_DPrintf ("%s programs occupy %iK.\n", PRVM_NAME, fs_filesize/1024);
+ Con_DPrintf("%s programs occupy %iK.\n", PRVM_NAME, fs_filesize/1024);
pr_crc = CRC_Block((qbyte *)prog->progs, fs_filesize);
/*
if (!sv.active)
{
- Con_Printf("no progs loaded\n");
+ Con_Print("no progs loaded\n");
return;
}
*/
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_fields <program name>\n");
+ Con_Print("prvm_fields <program name>\n");
return;
}
strcat(tempstring, "\n");
if (strlen(tempstring) >= 4096)
{
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
tempstring[0] = 0;
}
if (counts[i])
// TODO
/*if (!sv.active)
{
- Con_Printf("no progs loaded\n");
+ Con_Print("no progs loaded\n");
return;
}*/
if(Cmd_Argc () != 2)
{
- Con_Printf("prvm_globals <program name>\n");
+ Con_Print("prvm_globals <program name>\n");
return;
}