i &= 31;
while(count > 0)
{
- snprintf (temp, sizeof (temp), "%3i:%s ", cmdlog[i], cmdlogname[i]);
+ dpsnprintf (temp, sizeof (temp), "%3i:%s ", cmdlog[i], cmdlogname[i]);
strlcat (description, temp, sizeof (description));
count--;
i++;
s = string[stringindex];
stringindex = (stringindex + 1) & 7;
va_start (argptr, format);
- vsnprintf (s, sizeof (string[0]), format,argptr);
+ dpvsnprintf (s, sizeof (string[0]), format,argptr);
va_end (argptr);
return s;
}
+//======================================
+
+// snprintf and vsnprintf are NOT portable. Use their DP counterparts instead
+
+#undef snprintf
+#undef vsnprintf
+
+#ifdef WIN32
+# define snprintf _snprintf
+# define vsnprintf _vsnprintf
+#endif
+
+
+int dpsnprintf (char *buffer, size_t buffersize, const char *format, ...)
+{
+ va_list args;
+ int result;
+
+ va_start (args, format);
+ result = dpvsnprintf (buffer, buffersize, format, args);
+ va_end (args);
+
+ return result;
+}
+
+
+int dpvsnprintf (char *buffer, size_t buffersize, const char *format, va_list args)
+{
+ int result;
+
+ result = vsnprintf (buffer, buffersize, format, args);
+ if (result < 0 || (size_t)result >= buffersize)
+ {
+ buffer[buffersize - 1] = '\0';
+ return -1;
+ }
+
+ return result;
+}
+
+
//======================================
void COM_ToLowerString (const char *in, char *out, size_t size_out)
// MSVC has a different name for several standard functions
#ifdef WIN32
-# define snprintf _snprintf
-# define vsnprintf _vsnprintf
# define strcasecmp stricmp
# define strncasecmp strnicmp
#endif
// does a varargs printf into a temp buffer
+// snprintf and vsnprintf are NOT portable. Use their DP counterparts instead
+#define snprintf DO_NOT_USE_SNPRINTF__USE_DPSNPRINTF
+#define vsnprintf DO_NOT_USE_VSNPRINTF__USE_DPVSNPRINTF
+
+// dpsnprintf and dpvsnprintf
+// return the number of printed characters, excluding the final '\0'
+// or return -1 if the buffer isn't big enough to contain the entire string.
+// buffer is ALWAYS null-terminated
+extern int dpsnprintf (char *buffer, size_t buffersize, const char *format, ...);
+extern int dpvsnprintf (char *buffer, size_t buffersize, const char *format, va_list args);
+
+
//============================================================================
extern struct cvar_s registered;
strftime (timestring, sizeof (timestring), "%a %b %d %H:%M:%S %Y", crt_tm);
if (desc != NULL)
- snprintf (timestamp, sizeof (timestamp), "====== %s (%s) ======\n", desc, timestring);
+ dpsnprintf (timestamp, sizeof (timestamp), "====== %s (%s) ======\n", desc, timestring);
else
- snprintf (timestamp, sizeof (timestamp), "====== %s ======\n", timestring);
+ dpsnprintf (timestamp, sizeof (timestamp), "====== %s ======\n", timestring);
return timestamp;
}
char msg[MAXPRINTMSG];
va_start(argptr,fmt);
- vsnprintf(msg,sizeof(msg),fmt,argptr);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
Con_Print(msg);
return; // don't confuse non-developers with techie stuff...
va_start(argptr,fmt);
- vsnprintf(msg,sizeof(msg),fmt,argptr);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
Con_Print(msg);
{
if (matchpattern(current->text, "*.pak", true))
{
- snprintf (pakfile, sizeof (pakfile), "%s/%s", dir, current->text);
+ dpsnprintf (pakfile, sizeof (pakfile), "%s/%s", dir, current->text);
pak = FS_LoadPackPAK (pakfile);
if (pak)
{
{
if (matchpattern(current->text, "*.pk3", true))
{
- snprintf (pakfile, sizeof (pakfile), "%s/%s", dir, current->text);
+ dpsnprintf (pakfile, sizeof (pakfile), "%s/%s", dir, current->text);
pak = FS_LoadPackPK3 (pakfile);
if (pak)
{
else
{
char netpath[MAX_OSPATH];
- snprintf(netpath, sizeof(netpath), "%s/%s", search->filename, name);
+ dpsnprintf(netpath, sizeof(netpath), "%s/%s", search->filename, name);
if (FS_SysFileExists (netpath))
{
if (!quiet)
if (pack_ind < 0)
{
char path [MAX_OSPATH];
- snprintf (path, sizeof (path), "%s/%s", search->filename, filename);
+ dpsnprintf (path, sizeof (path), "%s/%s", search->filename, filename);
return FS_SysOpen (path, "rb");
}
char real_path [MAX_OSPATH];
// Open the file on disk directly
- snprintf (real_path, sizeof (real_path), "%s/%s", fs_gamedir, filepath);
+ dpsnprintf (real_path, sizeof (real_path), "%s/%s", fs_gamedir, filepath);
// Create directories up to the file
FS_CreatePath (real_path);
int FS_VPrintf (qfile_t* file, const char* format, va_list ap)
{
int len;
- char tempstring [1024];
+ size_t buff_size;
+ char *tempbuff = NULL;
- len = vsnprintf (tempstring, sizeof(tempstring), format, ap);
- if (len >= sizeof (tempstring))
+ buff_size = 1024;
+ tempbuff = Mem_Alloc (tempmempool, buff_size);
+ len = dpvsnprintf (tempbuff, buff_size, format, ap);
+ while (len < 0)
{
- char *temp = Mem_Alloc (tempmempool, len + 1);
- len = vsnprintf (temp, len + 1, format, ap);
- len = write (file->handle, temp, len);
- Mem_Free (temp);
- return len;
+ Mem_Free (tempbuff);
+ buff_size *= 2;
+ tempbuff = Mem_Alloc (tempmempool, buff_size);
+ len = dpvsnprintf (tempbuff, buff_size, format, ap);
}
- return write (file->handle, tempstring, len);
+ len = write (file->handle, tempbuff, len);
+ Mem_Free (tempbuff);
+
+ return len;
}
else
{
// get a directory listing and look at each name
- snprintf(netpath, sizeof (netpath), "%s/%s", searchpath->filename, basepath);
+ dpsnprintf(netpath, sizeof (netpath), "%s/%s", searchpath->filename, basepath);
if ((dir = listdirectory(netpath)))
{
for (dirfile = dir;dirfile;dirfile = dirfile->next)
{
- snprintf(temp, sizeof(temp), "%s/%s", basepath, dirfile->text);
+ dpsnprintf(temp, sizeof(temp), "%s/%s", basepath, dirfile->text);
if (matchpattern(temp, (char *)pattern, true))
{
for (listtemp = liststart;listtemp;listtemp = listtemp->next)
va_list argptr;
va_start (argptr,error);
- vsnprintf (hosterrorstring1,sizeof(hosterrorstring1),error,argptr);
+ dpvsnprintf (hosterrorstring1,sizeof(hosterrorstring1),error,argptr);
va_end (argptr);
Con_Printf("Host_Error: %s\n", hosterrorstring1);
char msg[4096];
va_start(argptr,fmt);
- vsnprintf(msg,sizeof(msg),fmt,argptr);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
SV_ClientPrint(msg);
char msg[4096];
va_start(argptr,fmt);
- vsnprintf(msg,sizeof(msg),fmt,argptr);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
va_end(argptr);
SV_BroadcastPrint(msg);
char string[1024];
va_start(argptr,fmt);
- vsnprintf(string, sizeof(string), fmt, argptr);
+ dpvsnprintf(string, sizeof(string), fmt, argptr);
va_end(argptr);
MSG_WriteByte(&host_client->message, svc_stufftext);
p1++;
}
if (!fromServer)
- snprintf (text, sizeof(text), "%c%s: %s", 1, host_client->name, p1);
+ dpsnprintf (text, sizeof(text), "%c%s: %s", 1, host_client->name, p1);
else
- snprintf (text, sizeof(text), "%c<%s> %s", 1, hostname.string, p1);
+ dpsnprintf (text, sizeof(text), "%c<%s> %s", 1, hostname.string, p1);
p2 = text + strlen(text);
while ((const char *)p2 > (const char *)text && (p2[-1] == '\r' || p2[-1] == '\n' || (p2[-1] == '\"' && quoted)))
{
kb = keybindings[key_bmap2][key];
if (kb && kb[0] == '+') {
- snprintf (cmd, sizeof(cmd), "-%s %i\n", kb + 1, key);
+ dpsnprintf (cmd, sizeof(cmd), "-%s %i\n", kb + 1, key);
Cbuf_AddText (cmd);
}
return;
kb = keybindings[key_bmap2][key];
if (kb) {
if (kb[0] == '+') { // button commands add keynum as a parm
- snprintf (cmd, sizeof(cmd), "%s %i\n", kb, key);
+ dpsnprintf (cmd, sizeof(cmd), "%s %i\n", kb, key);
Cbuf_AddText (cmd);
} else {
Cbuf_AddText (kb);
if ((flags & Q3SURFACEPARM_SKY) && sky[0])
{
// quake3 seems to append a _ to the skybox name, so this must do so as well
- snprintf(loadmodel->brush.skybox, sizeof(loadmodel->brush.skybox), "%s_", sky);
+ dpsnprintf(loadmodel->brush.skybox, sizeof(loadmodel->brush.skybox), "%s_", sky);
}
}
}
for( i = 0 ; i < 1024 ; i++ ) {
memset( &hostcache_cache[hostcache_cachecount], 0, sizeof( hostcache_t ) );
hostcache_cache[hostcache_cachecount].info.ping = rand() % 450 + 250;
- snprintf( hostcache_cache[hostcache_cachecount].info.name, 128, "Black's HostCache Test %i", i );
+ dpsnprintf( hostcache_cache[hostcache_cachecount].info.name, 128, "Black's HostCache Test %i", i );
hostcache_cache[hostcache_cachecount].finished = true;
sprintf( hostcache_cache[hostcache_cachecount].line1, "%i %s", hostcache_cache[hostcache_cachecount].info.ping, hostcache_cache[hostcache_cachecount].info.name );
_HostCache_Insert( &hostcache_cache[hostcache_cachecount] );
// legacy/old stuff move it to the menu ASAP
// build description strings for the things users care about
- snprintf(hostcache_cache[n].line1, sizeof(hostcache_cache[n].line1), "%5d%c%3u/%3u %-65.65s", (int)pingtime, info->protocol != NET_PROTOCOL_VERSION ? '*' : ' ', info->numplayers, info->maxplayers, info->name);
- snprintf(hostcache_cache[n].line2, sizeof(hostcache_cache[n].line2), "%-21.21s %-19.19s %-17.17s %-20.20s", info->cname, info->game, info->mod, info->map);
+ dpsnprintf(hostcache_cache[n].line1, sizeof(hostcache_cache[n].line1), "%5d%c%3u/%3u %-65.65s", (int)pingtime, info->protocol != NET_PROTOCOL_VERSION ? '*' : ' ', info->numplayers, info->maxplayers, info->name);
+ dpsnprintf(hostcache_cache[n].line2, sizeof(hostcache_cache[n].line2), "%-21.21s %-19.19s %-17.17s %-20.20s", info->cname, info->game, info->mod, info->map);
// if ping is especially high, display it as such
if (pingtime >= 300)
{
{
serverquerycount++;
- snprintf (ipstring, sizeof (ipstring), "%u.%u.%u.%u:%u", data[1], data[2], data[3], data[4], (data[5] << 8) | data[6]);
+ dpsnprintf (ipstring, sizeof (ipstring), "%u.%u.%u.%u:%u", data[1], data[2], data[3], data[4], (data[5] << 8) | data[6]);
if (developer.integer)
Con_Printf("Requesting info from server %s\n", ipstring);
// ignore the rest of the message if the hostcache is full
for (i = 0, n = 0;i < svs.maxclients;i++)
if (svs.clients[i].active)
n++;
- responselength = snprintf(response, sizeof(response), "\377\377\377\377infoResponse\x0A"
+ responselength = dpsnprintf(response, sizeof(response), "\377\377\377\377infoResponse\x0A"
"\\gamename\\%s\\modname\\%s\\sv_maxclients\\%d"
"\\clients\\%d\\mapname\\%s\\hostname\\%s\\protocol\\%d%s%s",
gamename, com_modname, svs.maxclients, n,
sv.name, hostname.string, NET_PROTOCOL_VERSION, challenge ? "\\challenge\\" : "", challenge ? challenge : "");
// does it fit in the buffer?
- if (responselength < (int)sizeof(response))
+ if (responselength >= 0)
{
if (developer.integer)
Con_Printf("Sending reply to master %s - %s\n", addressstring2, response);
#endif
// build the getservers
- snprintf(request, sizeof(request), "\377\377\377\377getservers %s %u empty full\x0A", gamename, NET_PROTOCOL_VERSION);
+ dpsnprintf(request, sizeof(request), "\377\377\377\377getservers %s %u empty full\x0A", gamename, NET_PROTOCOL_VERSION);
// search internet
for (masternum = 0;sv_masters[masternum].name;masternum++)
//n = NoCrash_NUM_FOR_EDICT(PROG_TO_EDICT(val->edict));
n = val->edict;
if (n < 0 || n >= MAX_EDICTS)
- snprintf (line, sizeof (line), "entity %i (invalid!)", n);
+ dpsnprintf (line, sizeof (line), "entity %i (invalid!)", n);
else
- snprintf (line, sizeof (line), "entity %i", n);
+ dpsnprintf (line, sizeof (line), "entity %i", n);
break;
case ev_function:
f = pr_functions + val->function;
- snprintf (line, sizeof (line), "%s()", PR_GetString(f->s_name));
+ dpsnprintf (line, sizeof (line), "%s()", PR_GetString(f->s_name));
break;
case ev_field:
def = ED_FieldAtOfs ( val->_int );
- snprintf (line, sizeof (line), ".%s", PR_GetString(def->s_name));
+ dpsnprintf (line, sizeof (line), ".%s", PR_GetString(def->s_name));
break;
case ev_void:
- snprintf (line, sizeof (line), "void");
+ dpsnprintf (line, sizeof (line), "void");
break;
case ev_float:
// LordHavoc: changed from %5.1f to %10.4f
- snprintf (line, sizeof (line), "%10.4f", val->_float);
+ dpsnprintf (line, sizeof (line), "%10.4f", val->_float);
break;
case ev_vector:
// LordHavoc: changed from %5.1f to %10.4f
- snprintf (line, sizeof (line), "'%10.4f %10.4f %10.4f'", val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, sizeof (line), "'%10.4f %10.4f %10.4f'", val->vector[0], val->vector[1], val->vector[2]);
break;
case ev_pointer:
- snprintf (line, sizeof (line), "pointer");
+ dpsnprintf (line, sizeof (line), "pointer");
break;
default:
- snprintf (line, sizeof (line), "bad type %i", type);
+ dpsnprintf (line, sizeof (line), "bad type %i", type);
break;
}
line[i] = '\0';
break;
case ev_entity:
- snprintf (line, sizeof (line), "%i", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)));
+ dpsnprintf (line, sizeof (line), "%i", NUM_FOR_EDICT(PROG_TO_EDICT(val->edict)));
break;
case ev_function:
f = pr_functions + val->function;
break;
case ev_field:
def = ED_FieldAtOfs ( val->_int );
- snprintf (line, sizeof (line), ".%s", PR_GetString(def->s_name));
+ dpsnprintf (line, sizeof (line), ".%s", PR_GetString(def->s_name));
break;
case ev_void:
- snprintf (line, sizeof (line), "void");
+ dpsnprintf (line, sizeof (line), "void");
break;
case ev_float:
- snprintf (line, sizeof (line), "%f", val->_float);
+ dpsnprintf (line, sizeof (line), "%f", val->_float);
break;
case ev_vector:
- snprintf (line, sizeof (line), "%f %f %f", val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, sizeof (line), "%f %f %f", val->vector[0], val->vector[1], val->vector[2]);
break;
default:
- snprintf (line, sizeof (line), "bad type %i", type);
+ dpsnprintf (line, sizeof (line), "bad type %i", type);
break;
}
val = (void *)&pr_globals[ofs];
def = ED_GlobalAtOfs(ofs);
if (!def)
- snprintf (line, sizeof (line), "%i(?)", ofs);
+ dpsnprintf (line, sizeof (line), "%i(?)", ofs);
else
{
s = PR_ValueString (def->type, val);
- snprintf (line, sizeof (line), "%i(%s)%s", ofs, PR_GetString(def->s_name), s);
+ dpsnprintf (line, sizeof (line), "%i(%s)%s", ofs, PR_GetString(def->s_name), s);
}
i = strlen(line);
def = ED_GlobalAtOfs(ofs);
if (!def)
- snprintf (line, sizeof (line), "%i(?)", ofs);
+ dpsnprintf (line, sizeof (line), "%i(?)", ofs);
else
- snprintf (line, sizeof (line), "%i(%s)", ofs, PR_GetString(def->s_name));
+ dpsnprintf (line, sizeof (line), "%i(%s)", ofs, PR_GetString(def->s_name));
i = strlen(line);
for ( ; i<20 ; i++)
}
tempstring[0] = 0;
- snprintf (tempstring, sizeof (tempstring), "\nEDICT %i:\n", NUM_FOR_EDICT(ed));
+ dpsnprintf (tempstring, sizeof (tempstring), "\nEDICT %i:\n", NUM_FOR_EDICT(ed));
for (i=1 ; i<progs->numfielddefs ; i++)
{
d = &pr_fielddefs[i];
{
char temp[32];
strlcpy (temp, com_token, sizeof (temp));
- snprintf (com_token, sizeof (com_token), "0 %s 0", temp);
+ dpsnprintf (com_token, sizeof (com_token), "0 %s 0", temp);
}
if (!ED_ParseEpair(ent, key, com_token))
strlcat (tempstring, "pointer ", sizeof (tempstring));
break;
default:
- snprintf (tempstring2, sizeof (tempstring2), "bad type %i ", d->type & ~DEF_SAVEGLOBAL);
+ dpsnprintf (tempstring2, sizeof (tempstring2), "bad type %i ", d->type & ~DEF_SAVEGLOBAL);
strlcat (tempstring, tempstring2, sizeof (tempstring));
break;
}
strcat (tempstring, name);
for (j = strlen(name);j < 25;j++)
strcat(tempstring, " ");
- snprintf (tempstring2, sizeof (tempstring2), "%5d", counts[i]);
+ dpsnprintf (tempstring2, sizeof (tempstring2), "%5d", counts[i]);
strlcat (tempstring, tempstring2, sizeof (tempstring));
strlcat (tempstring, "\n", sizeof (tempstring));
if (strlen(tempstring) >= 4096)
line[i] = '\0';
break;
case ev_entity:
- snprintf (line, sizeof (line), "%i", PRVM_NUM_FOR_EDICT(PRVM_PROG_TO_EDICT(val->edict)));
+ dpsnprintf (line, sizeof (line), "%i", PRVM_NUM_FOR_EDICT(PRVM_PROG_TO_EDICT(val->edict)));
break;
case ev_function:
f = pr_functions + val->function;
break;
case ev_field:
def = PRVM_ED_FieldAtOfs ( val->_int );
- snprintf (line, sizeof (line), ".%s", PRVM_GetString(def->s_name));
+ dpsnprintf (line, sizeof (line), ".%s", PRVM_GetString(def->s_name));
break;
case ev_void:
- snprintf (line, sizeof (line), "void");
+ dpsnprintf (line, sizeof (line), "void");
break;
case ev_float:
- snprintf (line, sizeof (line), "%f", val->_float);
+ dpsnprintf (line, sizeof (line), "%f", val->_float);
break;
case ev_vector:
- snprintf (line, sizeof (line), "%f %f %f", val->vector[0], val->vector[1], val->vector[2]);
+ dpsnprintf (line, sizeof (line), "%f %f %f", val->vector[0], val->vector[1], val->vector[2]);
break;
default:
- snprintf (line, sizeof (line), "bad type %i", type);
+ dpsnprintf (line, sizeof (line), "bad type %i", type);
break;
}
for (i = 0;i < 6;i++)
{
// generate an image name based on the base and and suffix
- snprintf(name, sizeof(name), "%s%s", basename, suffix[j][i].suffix);
+ dpsnprintf(name, sizeof(name), "%s%s", basename, suffix[j][i].suffix);
// load it
if ((image_rgba = loadimagepixels(name, false, cubemapsize, cubemapsize)))
{
success = 0;
for (i=0; i<6; i++)
{
- if (snprintf(name, sizeof(name), "%s_%s", skyname, suffix[j][i].suffix) >= (int)sizeof(name) || !(image_rgba = loadimagepixels(name, false, 0, 0)))
+ if (dpsnprintf(name, sizeof(name), "%s_%s", skyname, suffix[j][i].suffix) < 0 || !(image_rgba = loadimagepixels(name, false, 0, 0)))
{
- if (snprintf(name, sizeof(name), "%s%s", skyname, suffix[j][i].suffix) >= (int)sizeof(name) || !(image_rgba = loadimagepixels(name, false, 0, 0)))
+ if (dpsnprintf(name, sizeof(name), "%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_rgba = loadimagepixels(name, false, 0, 0)))
{
- if (snprintf(name, sizeof(name), "env/%s%s", skyname, suffix[j][i].suffix) >= (int)sizeof(name) || !(image_rgba = loadimagepixels(name, false, 0, 0)))
+ if (dpsnprintf(name, sizeof(name), "env/%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_rgba = loadimagepixels(name, false, 0, 0)))
{
- if (snprintf(name, sizeof(name), "gfx/env/%s%s", skyname, suffix[j][i].suffix) >= (int)sizeof(name) || !(image_rgba = loadimagepixels(name, false, 0, 0)))
+ if (dpsnprintf(name, sizeof(name), "gfx/env/%s%s", skyname, suffix[j][i].suffix) < 0 || !(image_rgba = loadimagepixels(name, false, 0, 0)))
continue;
}
}
framecount++;
calc = framerate;
}
- snprintf(fpsstring, sizeof(fpsstring), "%4i fps", calc);
+ dpsnprintf(fpsstring, sizeof(fpsstring), "%4i fps", calc);
}
if (showtime.integer)
strlcpy(timestring, Sys_TimeString(showtime_format.string), sizeof(timestring));
// LordHavoc: if the sound filename does not begin with sound/, try adding it
if (strncasecmp(s->name, "sound/", 6))
{
- len = snprintf (namebuffer, sizeof(namebuffer), "sound/%s", s->name);
- if (len >= sizeof (namebuffer))
+ len = dpsnprintf (namebuffer, sizeof(namebuffer), "sound/%s", s->name);
+ if (len < 0)
{
// name too long
Con_Printf("S_LoadSound: name \"%s\" is too long\n", s->name);
}
// LordHavoc: then try without the added sound/ as wav and ogg
- len = snprintf (namebuffer, sizeof(namebuffer), "%s", s->name);
- if (len >= sizeof (namebuffer))
+ len = dpsnprintf (namebuffer, sizeof(namebuffer), "%s", s->name);
+ if (len < 0)
{
// name too long
Con_Printf("S_LoadSound: name \"%s\" is too long\n", s->name);
client->entitydatabase5 = EntityFrame5_AllocDatabase(sv_clients_mempool);
MSG_WriteByte (&client->message, svc_print);
- snprintf (message, sizeof (message), "\002\nServer: %s build %s (progs %i crc)", gamename, buildstring, pr_crc);
+ dpsnprintf (message, sizeof (message), "\002\nServer: %s build %s (progs %i crc)", gamename, buildstring, pr_crc);
MSG_WriteString (&client->message,message);
MSG_WriteByte (&client->message, svc_serverinfo);
if (cls.state != ca_dedicated)
SCR_BeginLoadingPlaque();
- snprintf (modelname, sizeof(modelname), "maps/%s.bsp", server);
+ dpsnprintf (modelname, sizeof(modelname), "maps/%s.bsp", server);
worldmodel = Mod_ForName(modelname, false, true, true);
if (!worldmodel || !worldmodel->TraceBox)
{
strlcpy(sv.model_precache[1], sv.modelname, sizeof(sv.model_precache[1]));
for (i = 1;i < sv.worldmodel->brush.numsubmodels;i++)
{
- snprintf(sv.model_precache[i+1], sizeof(sv.model_precache[i+1]), "*%i", i);
+ dpsnprintf(sv.model_precache[i+1], sizeof(sv.model_precache[i+1]), "*%i", i);
sv.models[i+1] = Mod_ForName (sv.model_precache[i+1], false, false, false);
}
#endif
va_start (argptr,error);
- vsnprintf (string, sizeof (string), error, argptr);
+ dpvsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
fprintf(stderr, "Error: %s\n", string);
#endif
va_start (argptr,error);
- vsnprintf (string, sizeof (string), error, argptr);
+ dpvsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
fprintf(stderr, "Error: %s\n", string);
#else
os = "Unknown";
#endif
- snprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
+ dpsnprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
// COMMANDLINEOPTION: Console: -nostdout disables text output to the terminal the game was launched from
if (COM_CheckParm("-nostdout"))
static int in_sys_error3 = 0;
va_start (argptr, error);
- vsnprintf (text, sizeof (text), error, argptr);
+ dpvsnprintf (text, sizeof (text), error, argptr);
va_end (argptr);
Con_Printf ("Quake Error: %s\n", text);