The C standard reserves str* and mem* for the implementation.
Checking for BSD or OS X is not a robust way to determine if libc
provides these (eg glibc may implement them).
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
return;
}
for (n = 1; n <= ret; n++)
- strlcpy(remap[n], Cmd_Argv(cmd, n+1), sizeof(*remap));
+ dp_strlcpy(remap[n], Cmd_Argv(cmd, n+1), sizeof(*remap));
#endif
return;
}
break;
// if we don't find the desired track, use the first one
if (count == 0)
- strlcpy(trackname, com_token, sizeof(trackname));
+ dp_strlcpy(trackname, com_token, sizeof(trackname));
}
}
if (count > 0)
break;
if (listindex == current)
{
- strlcpy(trackname, com_token, sizeof(trackname));
+ dp_strlcpy(trackname, com_token, sizeof(trackname));
break;
}
}
if (cl.stats[STAT_ITEMS] & IT_QUAD)
{
if (temp[0])
- strlcat(temp, " ", sizeof(temp));
- strlcat(temp, "quad", sizeof(temp));
+ dp_strlcat(temp, " ", sizeof(temp));
+ dp_strlcat(temp, "quad", sizeof(temp));
}
if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY)
{
if (temp[0])
- strlcat(temp, " ", sizeof(temp));
- strlcat(temp, "pent", sizeof(temp));
+ dp_strlcat(temp, " ", sizeof(temp));
+ dp_strlcat(temp, "pent", sizeof(temp));
}
if (cl.stats[STAT_ITEMS] & IT_INVISIBILITY)
{
if (temp[0])
- strlcat(temp, " ", sizeof(temp));
- strlcat(temp, "eyes", sizeof(temp));
+ dp_strlcat(temp, " ", sizeof(temp));
+ dp_strlcat(temp, "eyes", sizeof(temp));
}
break;
case 'w': // weapon status (outputs "SSG:NG:SNG:GL:RL:LG" with the text between : characters omitted if you lack the weapon)
if (cl.stats[STAT_ITEMS] & IT_SUPER_SHOTGUN)
- strlcat(temp, "SSG", sizeof(temp));
- strlcat(temp, ":", sizeof(temp));
+ dp_strlcat(temp, "SSG", sizeof(temp));
+ dp_strlcat(temp, ":", sizeof(temp));
if (cl.stats[STAT_ITEMS] & IT_NAILGUN)
- strlcat(temp, "NG", sizeof(temp));
- strlcat(temp, ":", sizeof(temp));
+ dp_strlcat(temp, "NG", sizeof(temp));
+ dp_strlcat(temp, ":", sizeof(temp));
if (cl.stats[STAT_ITEMS] & IT_SUPER_NAILGUN)
- strlcat(temp, "SNG", sizeof(temp));
- strlcat(temp, ":", sizeof(temp));
+ dp_strlcat(temp, "SNG", sizeof(temp));
+ dp_strlcat(temp, ":", sizeof(temp));
if (cl.stats[STAT_ITEMS] & IT_GRENADE_LAUNCHER)
- strlcat(temp, "GL", sizeof(temp));
- strlcat(temp, ":", sizeof(temp));
+ dp_strlcat(temp, "GL", sizeof(temp));
+ dp_strlcat(temp, ":", sizeof(temp));
if (cl.stats[STAT_ITEMS] & IT_ROCKET_LAUNCHER)
- strlcat(temp, "RL", sizeof(temp));
- strlcat(temp, ":", sizeof(temp));
+ dp_strlcat(temp, "RL", sizeof(temp));
+ dp_strlcat(temp, ":", sizeof(temp));
if (cl.stats[STAT_ITEMS] & IT_LIGHTNING)
- strlcat(temp, "LG", sizeof(temp));
+ dp_strlcat(temp, "LG", sizeof(temp));
break;
default:
// not a recognized macro, print it as-is...
++cls.rcon_trying;
if(i >= MAX_RCONS)
NetConn_WriteString(mysocket, "\377\377\377\377getchallenge", &cls.rcon_address); // otherwise we'll request the challenge later
- strlcpy(cls.rcon_commands[cls.rcon_ringpos], Cmd_Args(cmd), sizeof(cls.rcon_commands[cls.rcon_ringpos]));
+ dp_strlcpy(cls.rcon_commands[cls.rcon_ringpos], Cmd_Args(cmd), sizeof(cls.rcon_commands[cls.rcon_ringpos]));
cls.rcon_addresses[cls.rcon_ringpos] = cls.rcon_address;
cls.rcon_timeout[cls.rcon_ringpos] = host.realtime + rcon_secure_challengetimeout.value;
cls.rcon_ringpos = (cls.rcon_ringpos + 1) % MAX_RCONS;
if(HMAC_MDFOUR_16BYTES((unsigned char *) (buf + 24), (unsigned char *) argbuf, (int)strlen(argbuf), (unsigned char *) rcon_password.string, n))
{
buf[40] = ' ';
- strlcpy(buf + 41, argbuf, sizeof(buf) - 41);
+ dp_strlcpy(buf + 41, argbuf, sizeof(buf) - 41);
NetConn_Write(mysocket, buf, 41 + (int)strlen(buf + 41), &cls.rcon_address);
}
}
return;
}
- strlcpy (cl.qw_serverinfo, Cmd_Argv(cmd, 1), sizeof(cl.qw_serverinfo));
+ dp_strlcpy (cl.qw_serverinfo, Cmd_Argv(cmd, 1), sizeof(cl.qw_serverinfo));
InfoString_GetValue(cl.qw_serverinfo, "teamplay", temp, sizeof(temp));
cl.qw_teamplay = atoi(temp);
}
if (len >= sizeof(key)) {
len = sizeof(key) - 1;
}
- strlcpy(key, s, len + 1);
+ dp_strlcpy(key, s, len + 1);
s += len;
if (!*s)
{
if (len >= sizeof(value)) {
len = sizeof(value) - 1;
}
- strlcpy(value, s, len + 1);
+ dp_strlcpy(value, s, len + 1);
CL_SetInfo(key, value, false, false, false, false);
track = -1;
// get the demo name
- strlcpy (name, Cmd_Argv(cmd, 1), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(cmd, 1), sizeof (name));
FS_DefaultExtension (name, ".dem", sizeof (name));
// start the map up
Con_Print(CON_ERROR "ERROR: couldn't open.\n");
return;
}
- strlcpy(cls.demoname, name, sizeof(cls.demoname));
+ dp_strlcpy(cls.demoname, name, sizeof(cls.demoname));
cls.forcetrack = track;
FS_Printf(cls.demofile, "%i\n", cls.forcetrack);
qfile_t *f;
// open the demo file
- strlcpy (name, demo, sizeof (name));
+ dp_strlcpy (name, demo, sizeof (name));
FS_DefaultExtension (name, ".dem", sizeof (name));
f = FS_OpenVirtualFile(name, false);
if (!f)
Con_Printf("Playing demo %s.\n", name);
cls.demofile = f;
- strlcpy(cls.demoname, name, sizeof(cls.demoname));
+ dp_strlcpy(cls.demoname, name, sizeof(cls.demoname));
cls.demoplayback = true;
cls.state = ca_connected;
Con_DPrintf("%i demo(s) in loop\n", c);
for (i=1 ; i<c+1 ; i++)
- strlcpy (cls.demos[i-1], Cmd_Argv(cmd, i), sizeof (cls.demos[i-1]));
+ dp_strlcpy (cls.demos[i-1], Cmd_Argv(cmd, i), sizeof (cls.demos[i-1]));
// LadyHavoc: clear the remaining slots
for (;i <= MAX_DEMOS;i++)
Con_Printf("no slot left for weapon definition; increase IN_BESTWEAPON_MAX\n");
return; // sorry
}
- strlcpy(in_bestweapon_info[i].name, name, sizeof(in_bestweapon_info[i].name));
+ dp_strlcpy(in_bestweapon_info[i].name, name, sizeof(in_bestweapon_info[i].name));
in_bestweapon_info[i].impulse = impulse;
if(weaponbit != -1)
in_bestweapon_info[i].weaponbit = weaponbit;
if(fmt && reason[0] != '\0')
dpsnprintf(cl_connect_status, sizeof(cl_connect_status), "Disconnect: %s", reason);
else
- strlcpy(cl_connect_status, "Disconnected", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Disconnected", sizeof(cl_connect_status));
Con_Printf("%s\n", cl_connect_status);
}
cls.state = ca_disconnected;
*cls.connect_userinfo = 0;
}
- strlcpy(cl_connect_status, "Connect: pending...", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Connect: pending...", sizeof(cl_connect_status));
SCR_BeginLoadingPlaque(false);
}
else
{
Con_Printf(CON_ERROR "Connect: failed, unable to find a network socket suitable to reach %s\n", address);
- strlcpy(cl_connect_status, "Connect: failed, no network", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Connect: failed, no network", sizeof(cl_connect_status));
}
}
dl->die = 0;
dl->cubemapname[0] = 0;
if (cubemapname && cubemapname[0])
- strlcpy(dl->cubemapname, cubemapname, sizeof(dl->cubemapname));
+ dp_strlcpy(dl->cubemapname, cubemapname, sizeof(dl->cubemapname));
dl->style = style;
dl->shadow = shadowenable;
dl->corona = corona;
r_refdef.fog_end = atof(Cmd_Argv(cmd, 7));
r_refdef.fog_height = atof(Cmd_Argv(cmd, 8));
r_refdef.fog_fadedepth = atof(Cmd_Argv(cmd, 9));
- strlcpy(r_refdef.fog_height_texturename, Cmd_Argv(cmd, 10), sizeof(r_refdef.fog_height_texturename));
+ dp_strlcpy(r_refdef.fog_height_texturename, Cmd_Argv(cmd, 10), sizeof(r_refdef.fog_height_texturename));
}
cl_locnode_t *loc;
loc = CL_Locs_FindNearest(point);
if (loc)
- strlcpy(buffer, loc->name, buffersize);
+ dp_strlcpy(buffer, loc->name, buffersize);
else
dpsnprintf(buffer, buffersize, "LOC=%.0f:%.0f:%.0f", point[0], point[1], point[2]);
}
if (com_token[0] == '}')
break; // end of worldspawn
if (com_token[0] == '_')
- strlcpy (key, com_token + 1, sizeof (key));
+ dp_strlcpy (key, com_token + 1, sizeof (key));
else
- strlcpy (key, com_token, sizeof (key));
+ dp_strlcpy (key, com_token, sizeof (key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
if (!COM_ParseToken_Simple(&data, false, false, true))
return; // error
- strlcpy (value, com_token, sizeof (value));
+ dp_strlcpy (value, com_token, sizeof (value));
if (!strcmp("sky", key))
{
loadedsky = true;
// set up csqc world for collision culling
if (cl.worldmodel)
{
- strlcpy(cl.worldname, cl.worldmodel->name, sizeof(cl.worldname));
+ dp_strlcpy(cl.worldname, cl.worldmodel->name, sizeof(cl.worldname));
FS_StripExtension(cl.worldname, cl.worldnamenoextension, sizeof(cl.worldnamenoextension));
- strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename));
+ dp_strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename));
Cvar_SetQuick(&cl_worldmessage, cl.worldmessage);
Cvar_SetQuick(&cl_worldname, cl.worldname);
Cvar_SetQuick(&cl_worldnamenoextension, cl.worldnamenoextension);
if (!cls.netcon)
return true;
- strlcpy(cls.qw_downloadname, filename, sizeof(cls.qw_downloadname));
+ dp_strlcpy(cls.qw_downloadname, filename, sizeof(cls.qw_downloadname));
Con_Printf("Downloading %s\n", filename);
if (!cls.qw_downloadmemory)
Host_Error("Server sent too many model precaches");
if (strlen(str) >= MAX_QPATH)
Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
- strlcpy(cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
+ dp_strlcpy(cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
}
n = MSG_ReadByte(&cl_message);
Host_Error("Server sent too many sound precaches");
if (strlen(str) >= MAX_QPATH)
Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
- strlcpy(cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
+ dp_strlcpy(cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
}
n = MSG_ReadByte(&cl_message);
InfoString_GetValue(cl.scores[slot].qw_userinfo, "team", cl.scores[slot].qw_team, sizeof(cl.scores[slot].qw_team));
InfoString_GetValue(cl.scores[slot].qw_userinfo, "skin", cl.scores[slot].qw_skin, sizeof(cl.scores[slot].qw_skin));
if (!cl.scores[slot].qw_skin[0])
- strlcpy(cl.scores[slot].qw_skin, "base", sizeof(cl.scores[slot].qw_skin));
+ dp_strlcpy(cl.scores[slot].qw_skin, "base", sizeof(cl.scores[slot].qw_skin));
// TODO: skin cache
}
return;
}
cl.scores[slot].qw_userid = MSG_ReadLong(&cl_message);
- strlcpy(cl.scores[slot].qw_userinfo, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(cl.scores[slot].qw_userinfo));
+ dp_strlcpy(cl.scores[slot].qw_userinfo, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(cl.scores[slot].qw_userinfo));
QW_CL_ProcessUserInfo(slot);
}
char key[2048];
char value[2048];
slot = MSG_ReadByte(&cl_message);
- strlcpy(key, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(key));
- strlcpy(value, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(value));
+ dp_strlcpy(key, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(key));
+ dp_strlcpy(value, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(value));
if (slot >= cl.maxclients)
{
Con_Printf("svc_setinfo >= cl.maxclients\n");
char key[2048];
char value[2048];
char temp[32];
- strlcpy(key, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(key));
- strlcpy(value, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(value));
+ dp_strlcpy(key, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(key));
+ dp_strlcpy(value, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(value));
Con_DPrintf("SERVERINFO: %s=%s\n", key, value);
InfoString_SetValue(cl.qw_serverinfo, sizeof(cl.qw_serverinfo), key, value);
InfoString_GetValue(cl.qw_serverinfo, "teamplay", temp, sizeof(temp));
CL_StopDownload(0, 0);
// we're really beginning a download now, so initialize stuff
- strlcpy(cls.qw_downloadname, Cmd_Argv(cmd, 2), sizeof(cls.qw_downloadname));
+ dp_strlcpy(cls.qw_downloadname, Cmd_Argv(cmd, 2), sizeof(cls.qw_downloadname));
cls.qw_downloadmemorymaxsize = size;
cls.qw_downloadmemory = (unsigned char *) Mem_Alloc(cls.permanentmempool, cls.qw_downloadmemorymaxsize);
cls.qw_downloadnumber++;
str = MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring));
Con_Printf("server gamedir is %s\n", str);
- strlcpy(gamedir[0], str, sizeof(gamedir[0]));
+ dp_strlcpy(gamedir[0], str, sizeof(gamedir[0]));
// change gamedir if needed
if (!FS_ChangeGameDirs(1, gamedir, true, false))
// get the full level name
str = MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring));
- strlcpy (cl.worldmessage, str, sizeof(cl.worldmessage));
+ dp_strlcpy (cl.worldmessage, str, sizeof(cl.worldmessage));
// get the movevars that are defined in the qw protocol
cl.movevars_gravity = MSG_ReadFloat(&cl_message);
// (we don't even know the name of the map yet)
// this also means cl_autodemo does not work on QW protocol...
- strlcpy(cl.worldname, "", sizeof(cl.worldname));
- strlcpy(cl.worldnamenoextension, "", sizeof(cl.worldnamenoextension));
- strlcpy(cl.worldbasename, "qw", sizeof(cl.worldbasename));
+ dp_strlcpy(cl.worldname, "", sizeof(cl.worldname));
+ dp_strlcpy(cl.worldnamenoextension, "", sizeof(cl.worldnamenoextension));
+ dp_strlcpy(cl.worldbasename, "qw", sizeof(cl.worldbasename));
Cvar_SetQuick(&cl_worldname, cl.worldname);
Cvar_SetQuick(&cl_worldnamenoextension, cl.worldnamenoextension);
Cvar_SetQuick(&cl_worldbasename, cl.worldbasename);
// parse signon message
str = MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring));
- strlcpy (cl.worldmessage, str, sizeof(cl.worldmessage));
+ dp_strlcpy (cl.worldmessage, str, sizeof(cl.worldmessage));
// seperate the printfs so the server message can have a color
if (cls.protocol != PROTOCOL_NEHAHRAMOVIE) // no messages when playing the Nehahra movie
Host_Error ("Server sent too many model precaches");
if (strlen(str) >= MAX_QPATH)
Host_Error ("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
- strlcpy (cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
+ dp_strlcpy (cl.model_name[nummodels], str, sizeof (cl.model_name[nummodels]));
}
// parse sound precache list
for (numsounds=1 ; ; numsounds++)
Host_Error("Server sent too many sound precaches");
if (strlen(str) >= MAX_QPATH)
Host_Error("Server sent a precache name of %i characters (max %i)", (int)strlen(str), MAX_QPATH - 1);
- strlcpy (cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
+ dp_strlcpy (cl.sound_name[numsounds], str, sizeof (cl.sound_name[numsounds]));
}
// set the base name for level-specific things... this gets updated again by CL_SetupWorldModel later
- strlcpy(cl.worldname, cl.model_name[1], sizeof(cl.worldname));
+ dp_strlcpy(cl.worldname, cl.model_name[1], sizeof(cl.worldname));
FS_StripExtension(cl.worldname, cl.worldnamenoextension, sizeof(cl.worldnamenoextension));
- strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename));
+ dp_strlcpy(cl.worldbasename, !strncmp(cl.worldnamenoextension, "maps/", 5) ? cl.worldnamenoextension + 5 : cl.worldnamenoextension, sizeof(cl.worldbasename));
Cvar_SetQuick(&cl_worldmessage, cl.worldmessage);
Cvar_SetQuick(&cl_worldname, cl.worldname);
Cvar_SetQuick(&cl_worldnamenoextension, cl.worldnamenoextension);
cls.forcetrack = -1;
FS_Printf (cls.demofile, "%i\n", cls.forcetrack);
cls.demorecording = true;
- strlcpy(cls.demoname, demofile, sizeof(cls.demoname));
+ dp_strlcpy(cls.demoname, demofile, sizeof(cls.demoname));
cls.demo_lastcsprogssize = -1;
cls.demo_lastcsprogscrc = -1;
}
sz_name = strlen(name) + 1;
cl_iplog_items[cl_iplog_numitems].address = (char *) Mem_Alloc(cls.permanentmempool, sz_address);
cl_iplog_items[cl_iplog_numitems].name = (char *) Mem_Alloc(cls.permanentmempool, sz_name);
- strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, sz_address);
+ dp_strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, sz_address);
// TODO: maybe it would be better to strip weird characters from name when
// copying it here rather than using a straight strcpy?
- strlcpy(cl_iplog_items[cl_iplog_numitems].name, name, sz_name);
+ dp_strlcpy(cl_iplog_items[cl_iplog_numitems].name, name, sz_name);
cl_iplog_numitems++;
if (addtofile)
{
{
char description[32*64], logtemp[64];
int count;
- strlcpy(description, "packet dump: ", sizeof(description));
+ dp_strlcpy(description, "packet dump: ", sizeof(description));
i = cmdcount - 32;
if (i < 0)
i = 0;
while(count > 0)
{
dpsnprintf(logtemp, sizeof(logtemp), "%3i:%s ", cmdlog[i], cmdlogname[i]);
- strlcat(description, logtemp, sizeof(description));
+ dp_strlcat(description, logtemp, sizeof(description));
count--;
i++;
i &= 31;
Con_Printf ("svc_lightstyle >= MAX_LIGHTSTYLES");
break;
}
- strlcpy (cl.lightstyle[i].map, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (cl.lightstyle[i].map));
+ dp_strlcpy (cl.lightstyle[i].map, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (cl.lightstyle[i].map));
cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
cl.lightstyle[i].length = (int)strlen(cl.lightstyle[i].map);
break;
{
char description[32*64], tempdesc[64];
int count;
- strlcpy (description, "packet dump: ", sizeof(description));
+ dp_strlcpy (description, "packet dump: ", sizeof(description));
i = cmdcount - 32;
if (i < 0)
i = 0;
while(count > 0)
{
dpsnprintf (tempdesc, sizeof (tempdesc), "%3i:%s ", cmdlog[i], cmdlogname[i]);
- strlcat (description, tempdesc, sizeof (description));
+ dp_strlcat (description, tempdesc, sizeof (description));
count--;
i++;
i &= 31;
Con_Printf ("svc_lightstyle >= MAX_LIGHTSTYLES");
break;
}
- strlcpy (cl.lightstyle[i].map, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (cl.lightstyle[i].map));
+ dp_strlcpy (cl.lightstyle[i].map, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (cl.lightstyle[i].map));
cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
cl.lightstyle[i].length = (int)strlen(cl.lightstyle[i].map);
break;
i = MSG_ReadByte(&cl_message);
if (i >= cl.maxclients)
Host_Error ("CL_ParseServerMessage: svc_updatename >= cl.maxclients");
- strlcpy (cl.scores[i].name, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (cl.scores[i].name));
+ dp_strlcpy (cl.scores[i].name, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (cl.scores[i].name));
break;
case svc_updatefrags:
break;
if (argc < 16)
{
- strlcpy(argv[argc], com_token, sizeof(argv[argc]));
+ dp_strlcpy(argv[argc], com_token, sizeof(argv[argc]));
argc++;
}
}
}
else
{
- strlcpy(particleeffectname[effectnameindex], argv[1], sizeof(particleeffectname[effectnameindex]));
+ dp_strlcpy(particleeffectname[effectnameindex], argv[1], sizeof(particleeffectname[effectnameindex]));
break;
}
}
memset(particleeffectinfo, 0, sizeof(particleeffectinfo));
memset(particleeffectname, 0, sizeof(particleeffectname));
for (i = 0;i < EFFECT_TOTAL;i++)
- strlcpy(particleeffectname[i], standardeffectnames[i], sizeof(particleeffectname[i]));
+ dp_strlcpy(particleeffectname[i], standardeffectnames[i], sizeof(particleeffectname[i]));
for (filepass = 0;;filepass++)
{
if (filepass == 0)
{
if (customfile)
- strlcpy(filename, customfile, sizeof(filename));
+ dp_strlcpy(filename, customfile, sizeof(filename));
else
- strlcpy(filename, "effectinfo.txt", sizeof(filename));
+ dp_strlcpy(filename, "effectinfo.txt", sizeof(filename));
}
else if (filepass == 1)
{
if (COM_ParseToken_Simple(&bufptr, true, false, true) && strcmp(com_token, "\n"))
{
- strlcpy(texturename, com_token, sizeof(texturename));
+ dp_strlcpy(texturename, com_token, sizeof(texturename));
s1 = atof(com_token);
if (COM_ParseToken_Simple(&bufptr, true, false, true) && strcmp(com_token, "\n"))
{
if (COM_ParseToken_Simple(&bufptr, true, false, true) && strcmp(com_token, "\n"))
{
t2 = atof(com_token);
- strlcpy(texturename, "particles/particlefont.tga", sizeof(texturename));
+ dp_strlcpy(texturename, "particles/particlefont.tga", sizeof(texturename));
if (COM_ParseToken_Simple(&bufptr, true, false, true) && strcmp(com_token, "\n"))
- strlcpy(texturename, com_token, sizeof(texturename));
+ dp_strlcpy(texturename, com_token, sizeof(texturename));
}
}
}
*/
void SCR_CenterPrint(const char *str)
{
- strlcpy (scr_centerstring, str, sizeof (scr_centerstring));
+ dp_strlcpy (scr_centerstring, str, sizeof (scr_centerstring));
scr_centertime_off = scr_centertime.value;
scr_centertime_start = cl.time;
c = Cmd_Argc(cmd);
if(c >= 2)
{
- strlcpy(msg, Cmd_Argv(cmd,1), sizeof(msg));
+ dp_strlcpy(msg, Cmd_Argv(cmd,1), sizeof(msg));
for(i = 2; i < c; ++i)
{
- strlcat(msg, " ", sizeof(msg));
- strlcat(msg, Cmd_Argv(cmd, i), sizeof(msg));
+ dp_strlcat(msg, " ", sizeof(msg));
+ dp_strlcat(msg, Cmd_Argv(cmd, i), sizeof(msg));
}
c = (unsigned int)strlen(msg);
for(p = 0, i = 0; i < c; ++i)
if(Cmd_Argc(cmd) == 3)
{
scr_infobartime_off = atof(Cmd_Argv(cmd, 1));
- strlcpy(scr_infobarstring, Cmd_Argv(cmd, 2), sizeof(scr_infobarstring));
+ dp_strlcpy(scr_infobarstring, Cmd_Argv(cmd, 2), sizeof(scr_infobarstring));
}
else
{
if (Cmd_Argc(cmd) == 2)
{
const char *ext;
- strlcpy(filename, Cmd_Argv(cmd, 1), sizeof(filename));
+ dp_strlcpy(filename, Cmd_Argv(cmd, 1), sizeof(filename));
ext = FS_FileExtension(filename);
if (!strcasecmp(ext, "jpg"))
{
{
if(SCR_ScreenShot (filename, buffer1, buffer2, 0, 0, vid.width, vid.height, false, false, false, false, false, true, scr_screenshot_alpha.integer != 0))
{
- strlcpy(filename + strlen(filename) - 3, "tga", 4);
+ dp_strlcpy(filename + strlen(filename) - 3, "tga", 4);
Con_Printf("Wrote %s\n", filename);
}
}
return;
}
- strlcpy (basename, Cmd_Argv(cmd, 1), sizeof (basename));
+ dp_strlcpy (basename, Cmd_Argv(cmd, 1), sizeof (basename));
size = atoi(Cmd_Argv(cmd, 2));
if (size != 128 && size != 256 && size != 512 && size != 1024)
{
int k;
char lmplabel[256], picname[256];
float x, y;
- strlcpy (lmplabel,MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (lmplabel));
- strlcpy (picname, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (picname));
+ dp_strlcpy (lmplabel,MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (lmplabel));
+ dp_strlcpy (picname, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof (picname));
if (gamemode == GAME_NEHAHRA) // LadyHavoc: nasty old legacy junk
{
x = MSG_ReadByte(&cl_message);
if (!cl.showlmps[k].isactive)
break;
cl.showlmps[k].isactive = true;
- strlcpy (cl.showlmps[k].label, lmplabel, sizeof (cl.showlmps[k].label));
- strlcpy (cl.showlmps[k].pic, picname, sizeof (cl.showlmps[k].pic));
+ dp_strlcpy (cl.showlmps[k].label, lmplabel, sizeof (cl.showlmps[k].label));
+ dp_strlcpy (cl.showlmps[k].pic, picname, sizeof (cl.showlmps[k].pic));
cl.showlmps[k].x = x;
cl.showlmps[k].y = y;
cl.num_showlmps = max(cl.num_showlmps, k + 1);
loadingscreenstack_t connect_status, *og_ptr = loadingscreenstack;
connect_status.absolute_loading_amount_min = 0;
- strlcpy(connect_status.msg, cl_connect_status, sizeof(cl_connect_status));
+ dp_strlcpy(connect_status.msg, cl_connect_status, sizeof(cl_connect_status));
loadingscreenstack = &connect_status;
SCR_DrawLoadingScreen();
loadingscreenstack = og_ptr;
s->prev = loadingscreenstack;
loadingscreenstack = s;
- strlcpy(s->msg, msg, sizeof(s->msg));
+ dp_strlcpy(s->msg, msg, sizeof(s->msg));
s->relative_completion = 0;
if(s->prev)
static clvideo_t* OpenVideo( clvideo_t *video, const char *filename, const char *name, int owner, const char *subtitlesfile )
{
- strlcpy(video->filename, filename, sizeof(video->filename));
+ dp_strlcpy(video->filename, filename, sizeof(video->filename));
dpsnprintf(video->name, sizeof(video->name), CLVIDEOPREFIX "%s", name);
video->ownertag = owner;
if( strncmp( name, CLVIDEOPREFIX, sizeof( CLVIDEOPREFIX ) - 1 ) )
{
sfx_t* sfx;
FS_StripExtension(filename, wavename, namelen);
- strlcat(wavename, ".wav", namelen);
+ dp_strlcat(wavename, ".wav", namelen);
sfx = S_PrecacheSound(wavename, false, false);
if (sfx != NULL)
s->sndchan = S_StartSound (-1, 0, sfx, vec3_origin, 1.0f, 0);
if (wavename)
{
FS_StripExtension(filename, wavename, len-1);
- strlcat(wavename, ".wav", len);
+ dp_strlcat(wavename, ".wav", len);
s->sfx = S_PrecacheSound(wavename, false, false);
s->sndchan = -1;
Z_Free(wavename);
VM_Warning(prog, "VM_CL_lightstyle >= MAX_LIGHTSTYLES\n");
return;
}
- strlcpy (cl.lightstyle[i].map, c, sizeof (cl.lightstyle[i].map));
+ dp_strlcpy (cl.lightstyle[i].map, c, sizeof (cl.lightstyle[i].map));
cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
cl.lightstyle[i].length = (int)strlen(cl.lightstyle[i].map);
}
if (i >= 0 && i < dp_fonts.maxsize)
{
f = &dp_fonts.f[i];
- strlcpy(f->title, fontname, sizeof(f->title)); // replace name
+ dp_strlcpy(f->title, fontname, sizeof(f->title)); // replace name
}
}
if (!f)
c = cm;
}
if(!c || (c - filelist) >= MAX_QPATH)
- strlcpy(mainfont, filelist, sizeof(mainfont));
+ dp_strlcpy(mainfont, filelist, sizeof(mainfont));
else
{
memcpy(mainfont, filelist, c - filelist);
}
if(!c || (c-filelist) >= MAX_QPATH)
{
- strlcpy(f->fallbacks[i], filelist, sizeof(mainfont));
+ dp_strlcpy(f->fallbacks[i], filelist, sizeof(mainfont));
}
else
{
VM_Warning(prog, "VM_CL_getstats: index>MAX_CL_STATS-4 or index<0\n");
return;
}
- strlcpy(t, (char*)&cl.stats[i], sizeof(t));
+ dp_strlcpy(t, (char*)&cl.stats[i], sizeof(t));
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, t);
}
t[0] = 0;
if(!strcasecmp(c, "name"))
- strlcpy(t, cl.scores[i].name, sizeof(t));
+ dp_strlcpy(t, cl.scores[i].name, sizeof(t));
else
if(!strcasecmp(c, "frags"))
dpsnprintf(t, sizeof(t), "%i", cl.scores[i].frags);
prog->polygonbegin_model = mod;
if (texname == NULL || texname[0] == 0)
texname = "$whiteimage";
- strlcpy(prog->polygonbegin_texname, texname, sizeof(prog->polygonbegin_texname));
+ dp_strlcpy(prog->polygonbegin_texname, texname, sizeof(prog->polygonbegin_texname));
prog->polygonbegin_drawflags = drawflags;
prog->polygonbegin_numvertices = 0;
}
}
cbuf->size += cmdsize;
- strlcpy(&node->text[offset], text, cmdsize + 1); // always sets the last char to \0
+ dp_strlcpy(&node->text[offset], text, cmdsize + 1); // always sets the last char to \0
//Con_Printf("^5Cbuf_LinkString(): %s `^7%s^5`\n", node->pending ? "append" : "new", &node->text[offset]);
node->pending = leavepending;
}
cmd_alias_t *prev, *current;
a = (cmd_alias_t *)Z_Malloc (sizeof(cmd_alias_t));
- strlcpy (a->name, s, sizeof (a->name));
+ dp_strlcpy (a->name, s, sizeof (a->name));
// insert it at the right alphanumeric position
for( prev = NULL, current = cmd->userdefined->alias ; current && strcmp( current->name, a->name ) < 0 ; prev = current, current = current->next )
;
for (i=2 ; i < c ; i++)
{
if (i != 2)
- strlcat (line, " ", sizeof (line));
- strlcat (line, Cmd_Argv(cmd, i), sizeof (line));
+ dp_strlcat (line, " ", sizeof (line));
+ dp_strlcat (line, Cmd_Argv(cmd, i), sizeof (line));
}
- strlcat (line, "\n", sizeof (line));
+ dp_strlcat (line, "\n", sizeof (line));
alloclen = strlen (line) + 1;
if(alloclen >= 2)
// if there are spaces in the game's network filter name it would
// cause parse errors in getservers in dpmaster, so we need to replace
// them with _ characters
- strlcpy(gamenetworkfilternamebuffer, gamenetworkfiltername, sizeof(gamenetworkfilternamebuffer));
+ dp_strlcpy(gamenetworkfilternamebuffer, gamenetworkfiltername, sizeof(gamenetworkfilternamebuffer));
while ((s = strchr(gamenetworkfilternamebuffer, ' ')) != NULL)
*s = '_';
gamenetworkfiltername = gamenetworkfilternamebuffer;
{
// set the key/value and append the remaining text
char tempbuffer[MAX_INPUTLINE];
- strlcpy(tempbuffer, buffer + pos2, sizeof(tempbuffer));
+ dp_strlcpy(tempbuffer, buffer + pos2, sizeof(tempbuffer));
dpsnprintf(buffer + pos, bufferlength - pos, "\\%s\\%s%s", key, value, tempbuffer);
}
else
{
// just remove the key from the text
- strlcpy(buffer + pos, buffer + pos2, bufferlength - pos);
+ dp_strlcpy(buffer + pos, buffer + pos2, bufferlength - pos);
}
}
/* $OpenBSD: strlcat.c,v 1.19 2019/01/25 00:19:25 millert Exp $ */
/* $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */
-
-#ifndef HAVE_STRLCAT
-size_t
-strlcat(char *dst, const char *src, size_t dsize)
+size_t dp_strlcat(char *dst, const char *src, size_t dsize)
{
const char *odst = dst;
const char *osrc = src;
return(dlen + (src - osrc)); /* count does not include NUL */
}
-#endif // #ifndef HAVE_STRLCAT
-
-#ifndef HAVE_STRLCPY
-size_t
-strlcpy(char *dst, const char *src, size_t dsize)
+size_t dp_strlcpy(char *dst, const char *src, size_t dsize)
{
const char *osrc = src;
size_t nleft = dsize;
return(src - osrc - 1); /* count does not include NUL */
}
-#endif // #ifndef HAVE_STRLCPY
void FindFraction(double val, int *num, int *denom, int denomMax)
{
while(COM_ParseToken_QuakeC(&in, false))
{
tokens[line] = lines[line];
- strlcpy(lines[line++], com_token, sizeof(lines[0]));
+ dp_strlcpy(lines[line++], com_token, sizeof(lines[0]));
if(!COM_ParseToken_QuakeC(&in, false))
return NULL;
if(!strcmp(com_token, "}"))
void COM_ToLowerString (const char *in, char *out, size_t size_out);
void COM_ToUpperString (const char *in, char *out, size_t size_out);
-// strlcat and strlcpy, from OpenBSD
-// Most (all?) BSDs already have them
-#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(MACOSX)
-# define HAVE_STRLCAT 1
-# define HAVE_STRLCPY 1
-#endif
-
-#ifndef HAVE_STRLCAT
/*!
* Appends src to string dst of size dsize (unlike strncat, dsize is the
* full size of dst, not space left). At most dsize-1 characters
* Returns strlen(src) + MIN(dsize, strlen(initial dst)).
* If retval >= dsize, truncation occurred.
*/
-size_t strlcat(char *dst, const char *src, size_t dsize);
-#endif // #ifndef HAVE_STRLCAT
+size_t dp_strlcat(char *dst, const char *src, size_t dsize);
-#ifndef HAVE_STRLCPY
/*!
* Copy string src to buffer dst of size dsize. At most dsize-1
* chars will be copied. Always NUL terminates (unless dsize == 0).
* Returns strlen(src); if retval >= dsize, truncation occurred.
*/
-size_t strlcpy(char *dst, const char *src, size_t dsize);
-
-#endif // #ifndef HAVE_STRLCPY
+size_t dp_strlcpy(char *dst, const char *src, size_t dsize);
void FindFraction(double val, int *num, int *denom, int denomMax);
static char copybuf[MAX_INPUTLINE]; // client only
con_lineinfo_t *l = &CONBUFFER_LINES(buf, i);
size_t sz = l->len+1 > sizeof(copybuf) ? sizeof(copybuf) : l->len+1;
- strlcpy(copybuf, l->start, sz);
+ dp_strlcpy(copybuf, l->start, sz);
return copybuf;
}
logfile = FS_OpenRealFile(log_file.string, "a", false);
if (logfile != NULL)
{
- strlcpy (crt_log_file, log_file.string, sizeof (crt_log_file));
+ dp_strlcpy (crt_log_file, log_file.string, sizeof (crt_log_file));
FS_Print (logfile, Log_Timestamp ("Log started"));
}
}
{
// empty prefix because ] is part of the console edit line
prefix = "";
- strlcpy(text, key_line, sizeof(text));
+ dp_strlcpy(text, key_line, sizeof(text));
linepos = key_linepos;
fnt = FONT_CONSOLE;
}
prefix = "say_team:";
else
prefix = "say:";
- strlcpy(text, chat_buffer, sizeof(text));
+ dp_strlcpy(text, chat_buffer, sizeof(text));
linepos = chat_bufferpos;
fnt = FONT_CHAT;
}
char entfilename[MAX_QPATH];
char desc[64];
desc[0] = 0;
- strlcpy(message, "^1ERROR: open failed^7", sizeof(message));
+ dp_strlcpy(message, "^1ERROR: open failed^7", sizeof(message));
p = 0;
f = FS_OpenVirtualFile(t->filenames[i], true);
if(f)
{
- strlcpy(message, "^1ERROR: not a known map format^7", sizeof(message));
+ dp_strlcpy(message, "^1ERROR: not a known map format^7", sizeof(message));
memset(buf, 0, 1024);
FS_Read(f, buf, 1024);
if (!memcmp(buf, "IBSP", 4))
}
else
dpsnprintf(desc, sizeof(desc), "unknown%i", BuffLittleLong(buf));
- strlcpy(entfilename, t->filenames[i], sizeof(entfilename));
+ dp_strlcpy(entfilename, t->filenames[i], sizeof(entfilename));
memcpy(entfilename + strlen(entfilename) - 4, ".ent", 5);
entities = (char *)FS_LoadFile(entfilename, tempmempool, true, NULL);
if (!entities && lumplen >= 10)
if (!strcmp(keyname, "message"))
{
// get the message contents
- strlcpy(message, com_token, sizeof(message));
+ dp_strlcpy(message, com_token, sizeof(message));
break;
}
}
if(match < 0)
continue;
//Con_Printf("Possible match: %s|%s\n", cl.scores[p].name, name);
- strlcpy(Nicks_list[count], cl.scores[p].name, sizeof(Nicks_list[count]));
+ dp_strlcpy(Nicks_list[count], cl.scores[p].name, sizeof(Nicks_list[count]));
// the sanitized list
- strlcpy(Nicks_sanlist[count], name, sizeof(Nicks_sanlist[count]));
+ dp_strlcpy(Nicks_sanlist[count], name, sizeof(Nicks_sanlist[count]));
if(!count)
{
Nicks_matchpos = match;
if(Nicks_strcleanlen(Nicks_sanlist[0]) < strlen(tempstr))
{
// if the clean sanitized one is longer than the current one, use it, it has crap chars which definitely are in there
- strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
+ dp_strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
}
}
if(Nicks_strcleanlen(Nicks_sanlist[0]) < strlen(tempstr))
{
// if the clean sanitized one is longer than the current one, use it, it has crap chars which definitely are in there
- strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
+ dp_strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
}
}
pos++;
s = line + pos;
- strlcpy(s2, line + linepos, sizeof(s2)); //save chars after cursor
+ dp_strlcpy(s2, line + linepos, sizeof(s2)); //save chars after cursor
line[linepos] = 0; //hide them
c = v = a = n = cmd_len = 0;
space = strchr(line + 1, ' ');
if(space && pos == (space - line) + 1)
{
- strlcpy(command, line + 1, min(sizeof(command), (unsigned int)(space - line)));
+ dp_strlcpy(command, line + 1, min(sizeof(command), (unsigned int)(space - line)));
patterns = Cvar_VariableString(cmd->cvars, va(vabuf, sizeof(vabuf), "con_completion_%s", command), CF_CLIENT | CF_SERVER); // TODO maybe use a better place for this?
if(patterns && !*patterns)
// and now do the actual work
*s = 0;
- strlcat(line, t, MAX_INPUTLINE);
- strlcat(line, s2, MAX_INPUTLINE); //add back chars after cursor
+ dp_strlcat(line, t, MAX_INPUTLINE);
+ dp_strlcat(line, s2, MAX_INPUTLINE); //add back chars after cursor
// and fix the cursor
if(linepos > (int) strlen(line))
const char *slash = strrchr(s, '/');
if(slash)
{
- strlcpy(t, s, min(sizeof(t), (unsigned int)(slash - s + 2))); // + 2, because I want to include the slash
- strlcat(t, com_token, sizeof(t));
+ dp_strlcpy(t, s, min(sizeof(t), (unsigned int)(slash - s + 2))); // + 2, because I want to include the slash
+ dp_strlcat(t, com_token, sizeof(t));
search = FS_Search(t, true, true, NULL);
}
else
const char *slash = strrchr(s, '/');
if(slash)
{
- strlcpy(t, s, min(sizeof(t), (unsigned int)(slash - s + 2))); // + 2, because I want to include the slash
- strlcat(t, "*", sizeof(t));
+ dp_strlcpy(t, s, min(sizeof(t), (unsigned int)(slash - s + 2))); // + 2, because I want to include the slash
+ dp_strlcat(t, "*", sizeof(t));
search = FS_Search(t, true, true, NULL);
}
else
// of resultbuf.strings[0]. We want to append the characters
// from resultbuf.strings[0] to (not including) p as these are
// the unique prefix
- strlcpy(t, (resultbuf.numstrings > 0 ? resultbuf : dirbuf).strings[0], min(matchchars + 1, sizeof(t)));
+ dp_strlcpy(t, (resultbuf.numstrings > 0 ? resultbuf : dirbuf).strings[0], min(matchchars + 1, sizeof(t)));
}
// first move the cursor
// and now do the actual work
*s = 0;
- strlcat(line, t, MAX_INPUTLINE);
- strlcat(line, s2, MAX_INPUTLINE); //add back chars after cursor
+ dp_strlcat(line, t, MAX_INPUTLINE);
+ dp_strlcat(line, s2, MAX_INPUTLINE); //add back chars after cursor
// and fix the cursor
if(linepos > (int) strlen(line))
if (!(c + v + a + n)) // No possible matches
{
if(s2[0])
- strlcpy(&line[linepos], s2, linesize - linepos);
+ dp_strlcpy(&line[linepos], s2, linesize - linepos);
return linepos;
}
// use strlcat to avoid a buffer overrun
line[linepos] = 0;
- strlcat(line, s2, linesize);
+ dp_strlcat(line, s2, linesize);
if (!is_console)
return linepos;
if(keyid)
*keyid = hk->keyid;
if(keyfp)
- strlcpy(keyfp, pubkeys_fp64[hk->keyid], keyfplen);
+ dp_strlcpy(keyfp, pubkeys_fp64[hk->keyid], keyfplen);
if(idfp)
- strlcpy(idfp, hk->idfp, idfplen);
+ dp_strlcpy(idfp, hk->idfp, idfplen);
if(aeslevel)
*aeslevel = hk->aeslevel;
if(issigned)
if(!pubkeys[keyid])
return -1;
if(keyfp)
- strlcpy(keyfp, pubkeys_fp64[keyid], keyfplen);
+ dp_strlcpy(keyfp, pubkeys_fp64[keyid], keyfplen);
if(idfp)
if(pubkeys_havepriv[keyid])
- strlcpy(idfp, pubkeys_priv_fp64[keyid], idfplen);
+ dp_strlcpy(idfp, pubkeys_priv_fp64[keyid], idfplen);
if(issigned)
*issigned = pubkeys_havesig[keyid];
return 1;
dpsnprintf(crypto_idstring_buf, sizeof(crypto_idstring_buf), "%d", d0_rijndael_dll ? crypto_aeslevel.integer : 0);
for (i = 0; i < MAX_PUBKEYS; ++i)
if (pubkeys[i])
- strlcat(crypto_idstring_buf, va(vabuf, sizeof(vabuf), " %s@%s%s", pubkeys_priv_fp64[i], pubkeys_havesig[i] ? "" : "~", pubkeys_fp64[i]), sizeof(crypto_idstring_buf));
+ dp_strlcat(crypto_idstring_buf, va(vabuf, sizeof(vabuf), " %s@%s%s", pubkeys_priv_fp64[i], pubkeys_havesig[i] ? "" : "~", pubkeys_fp64[i]), sizeof(crypto_idstring_buf));
crypto_idstring = crypto_idstring_buf;
}
{
Con_Printf("Generated private ID key_%d.d0pk (public key fingerprint: %s)\n", keygen_i, pubkeys_priv_fp64[keygen_i]);
pubkeys_havepriv[keygen_i] = true;
- strlcat(crypto_idstring_buf, va(vabuf, sizeof(vabuf), " %s@%s", pubkeys_priv_fp64[keygen_i], pubkeys_fp64[keygen_i]), sizeof(crypto_idstring_buf));
+ dp_strlcat(crypto_idstring_buf, va(vabuf, sizeof(vabuf), " %s@%s", pubkeys_priv_fp64[keygen_i], pubkeys_fp64[keygen_i]), sizeof(crypto_idstring_buf));
crypto_idstring = crypto_idstring_buf;
Crypto_BuildChallengeAppend();
}
if(CDATA->s >= 0)
{
// I am the server, and my key is ok... so let's set server_keyfp and server_idfp
- strlcpy(crypto->server_keyfp, pubkeys_fp64[CDATA->s], sizeof(crypto->server_keyfp));
- strlcpy(crypto->server_idfp, pubkeys_priv_fp64[CDATA->s], sizeof(crypto->server_idfp));
+ dp_strlcpy(crypto->server_keyfp, pubkeys_fp64[CDATA->s], sizeof(crypto->server_keyfp));
+ dp_strlcpy(crypto->server_idfp, pubkeys_priv_fp64[CDATA->s], sizeof(crypto->server_idfp));
crypto->server_issigned = pubkeys_havesig[CDATA->s];
if(!CDATA->id)
CLEAR_CDATA;
return Crypto_ServerError(data_out, len_out, "d0_blind_id_authenticate_with_private_id_verify failed (authentication error)", "Authentication error");
}
- strlcpy(crypto->client_keyfp, pubkeys_fp64[CDATA->c], sizeof(crypto->client_keyfp));
+ dp_strlcpy(crypto->client_keyfp, pubkeys_fp64[CDATA->c], sizeof(crypto->client_keyfp));
crypto->client_issigned = status;
memset(crypto->client_idfp, 0, sizeof(crypto->client_idfp));
CDATA->s = serverid;
CDATA->c = clientid;
memset(crypto->dhkey, 0, sizeof(crypto->dhkey));
- strlcpy(CDATA->challenge, challenge, sizeof(CDATA->challenge));
+ dp_strlcpy(CDATA->challenge, challenge, sizeof(CDATA->challenge));
crypto->client_keyfp[0] = 0;
crypto->client_idfp[0] = 0;
crypto->server_keyfp[0] = 0;
if(clientid >= 0)
{
// I am the client, and my key is ok... so let's set client_keyfp and client_idfp
- strlcpy(crypto->client_keyfp, pubkeys_fp64[CDATA->c], sizeof(crypto->client_keyfp));
- strlcpy(crypto->client_idfp, pubkeys_priv_fp64[CDATA->c], sizeof(crypto->client_idfp));
+ dp_strlcpy(crypto->client_keyfp, pubkeys_fp64[CDATA->c], sizeof(crypto->client_keyfp));
+ dp_strlcpy(crypto->client_idfp, pubkeys_priv_fp64[CDATA->c], sizeof(crypto->client_idfp));
crypto->client_issigned = pubkeys_havesig[CDATA->c];
}
return Crypto_ClientError(data_out, len_out, "d0_blind_id_authenticate_with_private_id_verify failed (server authentication error)");
}
- strlcpy(crypto->server_keyfp, pubkeys_fp64[CDATA->s], sizeof(crypto->server_keyfp));
+ dp_strlcpy(crypto->server_keyfp, pubkeys_fp64[CDATA->s], sizeof(crypto->server_keyfp));
if (!status && CDATA->wantserver_issigned)
{
CLEAR_CDATA;
cl.csqc_printtextbuf[0] = 0;
}
else
- strlcat(cl.csqc_printtextbuf, msg, MAX_INPUTLINE);
+ dp_strlcat(cl.csqc_printtextbuf, msg, MAX_INPUTLINE);
return;
}
- strlcat(cl.csqc_printtextbuf, msg, MAX_INPUTLINE);
+ dp_strlcat(cl.csqc_printtextbuf, msg, MAX_INPUTLINE);
CL_VM_Parse_Print(cl.csqc_printtextbuf);
cl.csqc_printtextbuf[0] = 0;
}
sfx_t* sfx;
FS_StripExtension(filename, wavename, namelen);
- strlcat(wavename, ".wav", namelen);
+ dp_strlcat(wavename, ".wav", namelen);
sfx = S_PrecacheSound (wavename, false, false);
if (sfx != NULL)
s->sndchan = S_StartSound (-1, 0, sfx, vec3_origin, 1.0f, 0);
int lenw = 0;
WIN32_FIND_DATAW n_file;
HANDLE hFile;
- strlcpy (pattern, basepath, sizeof(pattern));
- strlcat (pattern, path, sizeof (pattern));
- strlcat (pattern, "*", sizeof (pattern));
+ dp_strlcpy(pattern, basepath, sizeof(pattern));
+ dp_strlcat(pattern, path, sizeof (pattern));
+ dp_strlcat(pattern, "*", sizeof (pattern));
fromwtf8(pattern, strlen(pattern), patternw, BUFSIZE);
// ask for the directory listing handle
hFile = FindFirstFileW(patternw, &n_file);
// Create a package structure in memory
pack = (pack_t *)Mem_Alloc(fs_mempool, sizeof (pack_t));
pack->ignorecase = true; // PK3 ignores case
- strlcpy (pack->filename, packfile, sizeof (pack->filename));
+ dp_strlcpy (pack->filename, packfile, sizeof (pack->filename));
pack->handle = packhandle;
pack->numfiles = eocd.nbentries;
pack->files = (packfile_t *)Mem_Alloc(fs_mempool, eocd.nbentries * sizeof(packfile_t));
memmove (pfile + 1, pfile, (pack->numfiles - left) * sizeof (*pfile));
pack->numfiles++;
- strlcpy (pfile->name, name, sizeof (pfile->name));
+ dp_strlcpy (pfile->name, name, sizeof (pfile->name));
pfile->offset = offset;
pfile->packsize = packsize;
pfile->realsize = realsize;
pack = (pack_t *)Mem_Alloc(fs_mempool, sizeof (pack_t));
pack->ignorecase = true; // PAK is sensitive in Quake1 but insensitive in Quake2
- strlcpy (pack->filename, packfile, sizeof (pack->filename));
+ dp_strlcpy (pack->filename, packfile, sizeof (pack->filename));
pack->handle = packhandle;
pack->numfiles = 0;
pack->files = (packfile_t *)Mem_Alloc(fs_mempool, numpackfiles * sizeof(packfile_t));
pack = (pack_t *)Mem_Alloc(fs_mempool, sizeof (pack_t));
pack->vpack = true;
pack->ignorecase = false;
- strlcpy (pack->filename, dirname, sizeof(pack->filename));
+ dp_strlcpy (pack->filename, dirname, sizeof(pack->filename));
pack->handle = FILEDESC_INVALID;
pack->numfiles = -1;
pack->files = NULL;
if(pak)
{
- strlcpy(pak->shortname, shortname, sizeof(pak->shortname));
+ dp_strlcpy(pak->shortname, shortname, sizeof(pak->shortname));
//Con_DPrintf(" Registered pack with short name %s\n", shortname);
if(keep_plain_dirs)
stringlist_t list;
searchpath_t *search;
- strlcpy (fs_gamedir, dir, sizeof (fs_gamedir));
+ dp_strlcpy (fs_gamedir, dir, sizeof (fs_gamedir));
stringlistinit(&list);
listdirectory(&list, "", dir);
// Add the directory to the search path
// (unpacked files have the priority over packed files)
search = (searchpath_t *)Mem_Alloc(fs_mempool, sizeof(searchpath_t));
- strlcpy (search->filename, dir, sizeof (search->filename));
+ dp_strlcpy (search->filename, dir, sizeof (search->filename));
search->next = fs_searchpaths;
fs_searchpaths = search;
}
FS_AddGameHierarchy (gamedirname1);
// update the com_modname (used for server info)
if (gamedirname2 && gamedirname2[0])
- strlcpy(com_modname, gamedirname2, sizeof(com_modname));
+ dp_strlcpy(com_modname, gamedirname2, sizeof(com_modname));
else
- strlcpy(com_modname, gamedirname1, sizeof(com_modname));
+ dp_strlcpy(com_modname, gamedirname1, sizeof(com_modname));
// add the game-specific path, if any
// (only used for mission packs and the like, which should set fs_modified)
fs_modified = true;
FS_AddGameHierarchy (fs_gamedirs[i]);
// update the com_modname (used server info)
- strlcpy (com_modname, fs_gamedirs[i], sizeof (com_modname));
+ dp_strlcpy (com_modname, fs_gamedirs[i], sizeof (com_modname));
if(i)
- strlcat(gamedirbuf, va(vabuf, sizeof(vabuf), " %s", fs_gamedirs[i]), sizeof(gamedirbuf));
+ dp_strlcat(gamedirbuf, va(vabuf, sizeof(vabuf), " %s", fs_gamedirs[i]), sizeof(gamedirbuf));
else
- strlcpy(gamedirbuf, fs_gamedirs[i], sizeof(gamedirbuf));
+ dp_strlcpy(gamedirbuf, fs_gamedirs[i], sizeof(gamedirbuf));
}
Cvar_SetQuick(&cvar_fs_gamedir, gamedirbuf); // so QC or console code can query it
}
if((i = Sys_CheckParm("-modname")) && i < sys.argc - 1)
- strlcpy(com_modname, sys.argv[i+1], sizeof(com_modname));
+ dp_strlcpy(com_modname, sys.argv[i+1], sizeof(com_modname));
// If "-condebug" is in the command line, remove the previous log file
if (Sys_CheckParm ("-condebug") != 0)
fs_numgamedirs = numgamedirs;
for (i = 0;i < fs_numgamedirs;i++)
- strlcpy(fs_gamedirs[i], gamedirs[i], sizeof(fs_gamedirs[i]));
+ dp_strlcpy(fs_gamedirs[i], gamedirs[i], sizeof(fs_gamedirs[i]));
// reinitialize filesystem to detect the new paks
FS_Rescan();
}
for (i = 0;i < numgamedirs;i++)
- strlcpy(gamedirs[i], Cmd_Argv(cmd, i+1), sizeof(gamedirs[i]));
+ dp_strlcpy(gamedirs[i], Cmd_Argv(cmd, i+1), sizeof(gamedirs[i]));
if ((cls.state == ca_connected && !cls.demoplayback) || sv.active)
{
continue;
if(!*info)
continue;
- strlcpy(fs_all_gamedirs[fs_all_gamedirs_count].name, list2.strings[i], sizeof(fs_all_gamedirs[fs_all_gamedirs_count].name));
- strlcpy(fs_all_gamedirs[fs_all_gamedirs_count].description, info, sizeof(fs_all_gamedirs[fs_all_gamedirs_count].description));
+ dp_strlcpy(fs_all_gamedirs[fs_all_gamedirs_count].name, list2.strings[i], sizeof(fs_all_gamedirs[fs_all_gamedirs_count].name));
+ dp_strlcpy(fs_all_gamedirs[fs_all_gamedirs_count].description, info, sizeof(fs_all_gamedirs[fs_all_gamedirs_count].description));
++fs_all_gamedirs_count;
}
}
if(i > args_left)
break;
q = (char *)Mem_Alloc(fs_mempool, sz);
- strlcpy(q, com_token, sz);
+ dp_strlcpy(q, com_token, sz);
new_argv[i] = q;
++i;
}
{
// fs_basedir is "" by default, to utilize this you can simply add your gamedir to the Resources in xcode
// fs_userdir stores configurations to the Documents folder of the app
- strlcpy(userdir, "../Documents/", MAX_OSPATH);
+ dp_strlcpy(userdir, "../Documents/", MAX_OSPATH);
return 1;
}
return -1;
default:
return -1;
case USERDIRMODE_NOHOME:
- strlcpy(userdir, fs_basedir, userdirsize);
+ dp_strlcpy(userdir, fs_basedir, userdirsize);
break;
case USERDIRMODE_MYGAMES:
if (!shfolder_dll)
default:
return -1;
case USERDIRMODE_NOHOME:
- strlcpy(userdir, fs_basedir, userdirsize);
+ dp_strlcpy(userdir, fs_basedir, userdirsize);
break;
case USERDIRMODE_HOME:
homedir = getenv("HOME");
i = Sys_CheckParm ("-basedir");
if (i && i < sys.argc-1)
{
- strlcpy (fs_basedir, sys.argv[i+1], sizeof (fs_basedir));
+ dp_strlcpy (fs_basedir, sys.argv[i+1], sizeof (fs_basedir));
i = (int)strlen (fs_basedir);
if (i > 0 && (fs_basedir[i-1] == '\\' || fs_basedir[i-1] == '/'))
fs_basedir[i-1] = 0;
{
// If the base directory is explicitly defined by the compilation process
#ifdef DP_FS_BASEDIR
- strlcpy(fs_basedir, DP_FS_BASEDIR, sizeof(fs_basedir));
+ dp_strlcpy(fs_basedir, DP_FS_BASEDIR, sizeof(fs_basedir));
#elif defined(__ANDROID__)
dpsnprintf(fs_basedir, sizeof(fs_basedir), "/sdcard/%s/", gameuserdirname);
#elif defined(MACOSX)
if (strstr(sys.argv[0], ".app/"))
{
char *split;
- strlcpy(fs_basedir, sys.argv[0], sizeof(fs_basedir));
+ dp_strlcpy(fs_basedir, sys.argv[0], sizeof(fs_basedir));
split = strstr(fs_basedir, ".app/");
if (split)
{
if (stat(va(vabuf, sizeof(vabuf), "%s/Contents/Resources/%s", fs_basedir, gamedirname1), &statresult) == 0)
{
// found gamedir inside Resources, use it
- strlcat(fs_basedir, "Contents/Resources/", sizeof(fs_basedir));
+ dp_strlcat(fs_basedir, "Contents/Resources/", sizeof(fs_basedir));
}
else
{
memset(fs_basedir + sizeof(fs_basedir) - 2, 0, 2);
// add a path separator to the end of the basedir if it lacks one
if (fs_basedir[0] && fs_basedir[strlen(fs_basedir) - 1] != '/' && fs_basedir[strlen(fs_basedir) - 1] != '\\')
- strlcat(fs_basedir, "/", sizeof(fs_basedir));
+ dp_strlcat(fs_basedir, "/", sizeof(fs_basedir));
// Add the personal game directory
if((i = Sys_CheckParm("-userdir")) && i < sys.argc - 1)
else
{
#ifdef DP_FS_USERDIR
- strlcpy(fs_userdir, DP_FS_USERDIR, sizeof(fs_userdir));
+ dp_strlcpy(fs_userdir, DP_FS_USERDIR, sizeof(fs_userdir));
#else
int dirmode;
int highestuserdirmode = USERDIRMODE_COUNT - 1;
if(p == fs_checkgamedir_missing)
Con_Printf(CON_WARN "WARNING: -game %s%s/ not found!\n", fs_basedir, sys.argv[i]);
// add the gamedir to the list of active gamedirs
- strlcpy (fs_gamedirs[fs_numgamedirs], sys.argv[i], sizeof(fs_gamedirs[fs_numgamedirs]));
+ dp_strlcpy (fs_gamedirs[fs_numgamedirs], sys.argv[i], sizeof(fs_gamedirs[fs_numgamedirs]));
fs_numgamedirs++;
}
}
src--;
}
- strlcat (path, extension, size_path);
+ dp_strlcat (path, extension, size_path);
}
for (i = 0;i < pak->numfiles;i++)
{
char temp[MAX_OSPATH];
- strlcpy(temp, pak->files[i].name, sizeof(temp));
+ dp_strlcpy(temp, pak->files[i].name, sizeof(temp));
while (temp[0])
{
if (matchpattern(temp, (char *)pattern, true))
// prevseparator points past the '/' right before the wildcard and nextseparator at the one following it (or at the end of the string)
// copy everything up except nextseperator
- strlcpy(subpattern, pattern, min(sizeof(subpattern), (size_t) (nextseparator - pattern + 1)));
+ dp_strlcpy(subpattern, pattern, min(sizeof(subpattern), (size_t) (nextseparator - pattern + 1)));
// find the last '/' before the wildcard
prevseparator = strrchr( subpattern, '/' );
if (!prevseparator)
prevseparator++;
// copy everything from start to the previous including the '/' (before the wildcard)
// everything up to start is already included in the path of matchedSet's entries
- strlcpy(subpath, start, min(sizeof(subpath), (size_t) ((prevseparator - subpattern) - (start - pattern) + 1)));
+ dp_strlcpy(subpath, start, min(sizeof(subpath), (size_t) ((prevseparator - subpattern) - (start - pattern) + 1)));
// for each entry in matchedSet try to open the subdirectories specified in subpath
for( dirlistindex = 0 ; dirlistindex < matchedSet.numstrings ; dirlistindex++ ) {
char temp[MAX_OSPATH];
- strlcpy( temp, matchedSet.strings[ dirlistindex ], sizeof(temp) );
- strlcat( temp, subpath, sizeof(temp) );
+ dp_strlcpy( temp, matchedSet.strings[ dirlistindex ], sizeof(temp) );
+ dp_strlcat( temp, subpath, sizeof(temp) );
listdirectory( &foundSet, searchpath->filename, temp );
}
if( dirlistindex == 0 ) {
for(i = 0; i < MAX_FONTFILES; ++i)
if(fontfiles[i].refcount <= 0)
{
- strlcpy(fontfiles[i].path, path, sizeof(fontfiles[i].path));
+ dp_strlcpy(fontfiles[i].path, path, sizeof(fontfiles[i].path));
fontfiles[i].len = *filesizepointer;
fontfiles[i].buf = buf;
fontfiles[i].refcount = 1;
Mem_Free(ft2);
return false;
}
- strlcpy(ft2->name, name, sizeof(ft2->name));
+ dp_strlcpy(ft2->name, name, sizeof(ft2->name));
ft2->image_font = true;
ft2->has_kerning = false;
}
Con_Printf(CON_ERROR "Failed to add attachment %u to %s\n", (unsigned)i, font->name);
}
- strlcpy(font->name, name, sizeof(font->name));
+ dp_strlcpy(font->name, name, sizeof(font->name));
font->image_font = false;
font->has_kerning = !!(((FT_Face)(font->face))->face_flags & FT_FACE_FLAG_KERNING);
return true;
buffer->isuniformbuffer = isuniformbuffer;
buffer->isdynamic = isdynamic;
buffer->isindex16 = isindex16;
- strlcpy(buffer->name, name, sizeof(buffer->name));
+ dp_strlcpy(buffer->name, name, sizeof(buffer->name));
R_Mesh_UpdateMeshBuffer(buffer, data, size, false, 0);
return buffer;
}
Con_DPrintf("Draw_CachePic(\"%s\"): frame %i: loading pic%s\n", path, draw_frame, (cachepicflags & CACHEPICFLAG_NOTPERSISTENT) ? " notpersist" : "");
pic = cachepics + (numcachepics++);
memset(pic, 0, sizeof(*pic));
- strlcpy (pic->name, path, sizeof(pic->name));
+ dp_strlcpy (pic->name, path, sizeof(pic->name));
// link into list
pic->chain = cachepichash[hashkey];
cachepichash[hashkey] = pic;
Con_DPrintf("Draw_NewPic(\"%s\"): frame %i: creating new cachepic\n", picname, draw_frame);
pic = cachepics + (numcachepics++);
memset(pic, 0, sizeof(*pic));
- strlcpy (pic->name, picname, sizeof(pic->name));
+ dp_strlcpy (pic->name, picname, sizeof(pic->name));
// link into list
pic->chain = cachepichash[hashkey];
cachepichash[hashkey] = pic;
if(override || !fnt->texpath[0])
{
- strlcpy(fnt->texpath, name, sizeof(fnt->texpath));
+ dp_strlcpy(fnt->texpath, name, sizeof(fnt->texpath));
// load the cvars when the font is FIRST loader
fnt->settings.scale = scale;
fnt->settings.voffset = voffset;
if(!Draw_IsPicLoaded(fnt->pic))
{
fnt->pic = Draw_CachePic_Flags("gfx/conchars", CACHEPICFLAG_NOCOMPRESSION | (r_nearest_conchars.integer ? CACHEPICFLAG_NEAREST : 0));
- strlcpy(widthfile, "gfx/conchars.width", sizeof(widthfile));
+ dp_strlcpy(widthfile, "gfx/conchars.width", sizeof(widthfile));
}
else
dpsnprintf(widthfile, sizeof(widthfile), "%s.width", fnt->fallbacks[i]);
{
if(!strcmp(dp_fonts.f[i].title, ""))
{
- strlcpy(dp_fonts.f[i].title, title, sizeof(dp_fonts.f[i].title));
+ dp_strlcpy(dp_fonts.f[i].title, title, sizeof(dp_fonts.f[i].title));
return &dp_fonts.f[i];
}
}
if (dp_fonts.f[i].ft2)
dp_fonts.f[i].ft2->settings = &dp_fonts.f[i].settings;
// register a font in first expanded slot
- strlcpy(dp_fonts.f[oldsize].title, title, sizeof(dp_fonts.f[oldsize].title));
+ dp_strlcpy(dp_fonts.f[oldsize].title, title, sizeof(dp_fonts.f[oldsize].title));
return &dp_fonts.f[oldsize];
}
return NULL;
else
{
if (strcmp(cmd->cmdline, f->cmdline) != 0 || r_font_always_reload.integer)
- strlcpy(f->cmdline, cmd->cmdline, MAX_FONT_CMDLINE);
+ dp_strlcpy(f->cmdline, cmd->cmdline, MAX_FONT_CMDLINE);
else
{
Con_DPrintf("LoadFont: font %s is unchanged\n", Cmd_Argv(cmd, 1));
}
if(!c || (c - filelist) >= MAX_QPATH)
- strlcpy(mainfont, filelist, sizeof(mainfont));
+ dp_strlcpy(mainfont, filelist, sizeof(mainfont));
else
{
memcpy(mainfont, filelist, c - filelist);
}
if(!c || (c-filelist) >= MAX_QPATH)
{
- strlcpy(f->fallbacks[i], filelist, sizeof(mainfont));
+ dp_strlcpy(f->fallbacks[i], filelist, sizeof(mainfont));
}
else
{
memset(dp_fonts.f, 0, sizeof(dp_font_t) * dp_fonts.maxsize);
// assign starting font names
- strlcpy(FONT_DEFAULT->title, "default", sizeof(FONT_DEFAULT->title));
- strlcpy(FONT_DEFAULT->texpath, "gfx/conchars", sizeof(FONT_DEFAULT->texpath));
- strlcpy(FONT_CONSOLE->title, "console", sizeof(FONT_CONSOLE->title));
- strlcpy(FONT_SBAR->title, "sbar", sizeof(FONT_SBAR->title));
- strlcpy(FONT_NOTIFY->title, "notify", sizeof(FONT_NOTIFY->title));
- strlcpy(FONT_CHAT->title, "chat", sizeof(FONT_CHAT->title));
- strlcpy(FONT_CENTERPRINT->title, "centerprint", sizeof(FONT_CENTERPRINT->title));
- strlcpy(FONT_INFOBAR->title, "infobar", sizeof(FONT_INFOBAR->title));
- strlcpy(FONT_MENU->title, "menu", sizeof(FONT_MENU->title));
+ dp_strlcpy(FONT_DEFAULT->title, "default", sizeof(FONT_DEFAULT->title));
+ dp_strlcpy(FONT_DEFAULT->texpath, "gfx/conchars", sizeof(FONT_DEFAULT->texpath));
+ dp_strlcpy(FONT_CONSOLE->title, "console", sizeof(FONT_CONSOLE->title));
+ dp_strlcpy(FONT_SBAR->title, "sbar", sizeof(FONT_SBAR->title));
+ dp_strlcpy(FONT_NOTIFY->title, "notify", sizeof(FONT_NOTIFY->title));
+ dp_strlcpy(FONT_CHAT->title, "chat", sizeof(FONT_CHAT->title));
+ dp_strlcpy(FONT_CENTERPRINT->title, "centerprint", sizeof(FONT_CENTERPRINT->title));
+ dp_strlcpy(FONT_INFOBAR->title, "infobar", sizeof(FONT_INFOBAR->title));
+ dp_strlcpy(FONT_MENU->title, "menu", sizeof(FONT_MENU->title));
for(i = 0, j = 0; i < MAX_USERFONTS; ++i)
if(!FONT_USER(i)->title[0])
dpsnprintf(FONT_USER(i)->title, sizeof(FONT_USER(i)->title), "user%d", j++);
float c[4];
float f;
inpixels = NULL;
- strlcpy(r_refdef.fogheighttexturename, r_refdef.fog_height_texturename, sizeof(r_refdef.fogheighttexturename));
+ dp_strlcpy(r_refdef.fogheighttexturename, r_refdef.fog_height_texturename, sizeof(r_refdef.fogheighttexturename));
if (r_refdef.fogheighttexturename[0])
inpixels = loadimagepixelsbgra(r_refdef.fogheighttexturename, true, false, false, NULL);
if (!inpixels)
permutationname[0] = 0;
sourcestring = ShaderModeInfo_GetShaderText(modeinfo, true, false);
- strlcat(permutationname, modeinfo->filename, sizeof(permutationname));
+ dp_strlcat(permutationname, modeinfo->filename, sizeof(permutationname));
// we need 140 for r_glsl_skeletal (GL_ARB_uniform_buffer_object)
if(vid.support.glshaderversion >= 140)
vertstrings_list[vertstrings_count++] = modeinfo->pretext;
geomstrings_list[geomstrings_count++] = modeinfo->pretext;
fragstrings_list[fragstrings_count++] = modeinfo->pretext;
- strlcat(permutationname, modeinfo->name, sizeof(permutationname));
+ dp_strlcat(permutationname, modeinfo->name, sizeof(permutationname));
// now add all the permutation pretexts
for (i = 0;i < SHADERPERMUTATION_COUNT;i++)
vertstrings_list[vertstrings_count++] = shaderpermutationinfo[i].pretext;
geomstrings_list[geomstrings_count++] = shaderpermutationinfo[i].pretext;
fragstrings_list[fragstrings_count++] = shaderpermutationinfo[i].pretext;
- strlcat(permutationname, shaderpermutationinfo[i].name, sizeof(permutationname));
+ dp_strlcat(permutationname, shaderpermutationinfo[i].name, sizeof(permutationname));
}
else
{
return NULL;
item = (skinframe_t *)Mem_ExpandableArray_AllocRecord(&r_skinframe.array);
memset(item, 0, sizeof(*item));
- strlcpy(item->basename, basename, sizeof(item->basename));
+ dp_strlcpy(item->basename, basename, sizeof(item->basename));
item->textureflags = compareflags;
item->comparewidth = comparewidth;
item->compareheight = compareheight;
return r_texture_whitecube;
r_texture_numcubemaps++;
r_texture_cubemaps[i] = (cubemapinfo_t *)Mem_Alloc(r_main_mempool, sizeof(cubemapinfo_t));
- strlcpy(r_texture_cubemaps[i]->basename, basename, sizeof(r_texture_cubemaps[i]->basename));
+ dp_strlcpy(r_texture_cubemaps[i]->basename, basename, sizeof(r_texture_cubemaps[i]->basename));
r_texture_cubemaps[i]->texture = R_LoadCubemap(r_texture_cubemaps[i]->basename);
return r_texture_cubemaps[i]->texture;
}
char name[MAX_QPATH];
skinframe_t *skinframe;
unsigned char pixels[296*194];
- strlcpy(cache->name, skinname, sizeof(cache->name));
+ dp_strlcpy(cache->name, skinname, sizeof(cache->name));
dpsnprintf(name, sizeof(name), "skins/%s.pcx", cache->name);
if (developer_loading.integer)
Con_Printf("loading %s\n", name);
glt = (gltexture_t *)Mem_ExpandableArray_AllocRecord(&texturearray);
if (identifier)
- strlcpy (glt->identifier, identifier, sizeof(glt->identifier));
+ dp_strlcpy (glt->identifier, identifier, sizeof(glt->identifier));
glt->pool = pool;
glt->chain = pool->gltchain;
pool->gltchain = glt;
glt = (gltexture_t *)Mem_ExpandableArray_AllocRecord(&texturearray);
if (identifier)
- strlcpy (glt->identifier, identifier, sizeof(glt->identifier));
+ dp_strlcpy (glt->identifier, identifier, sizeof(glt->identifier));
glt->pool = pool;
glt->chain = pool->gltchain;
pool->gltchain = glt;
texinfo = R_GetTexTypeInfo(textype, flags);
- strlcpy (glt->identifier, vabuf, sizeof(glt->identifier));
+ dp_strlcpy(glt->identifier, vabuf, sizeof(glt->identifier));
glt->pool = pool;
glt->chain = pool->gltchain;
pool->gltchain = glt;
texinfo = R_GetTexTypeInfo(textype, flags);
glt = (gltexture_t *)Mem_ExpandableArray_AllocRecord(&texturearray);
- strlcpy (glt->identifier, filename, sizeof(glt->identifier));
+ dp_strlcpy (glt->identifier, filename, sizeof(glt->identifier));
glt->pool = pool;
glt->chain = pool->gltchain;
pool->gltchain = glt;
Sys_Error ("Host_Error: recursively entered (original error was: %s new error is: %s)", hosterrorstring2, hosterrorstring1);
hosterror = true;
- strlcpy(hosterrorstring2, hosterrorstring1, sizeof(hosterrorstring2));
+ dp_strlcpy(hosterrorstring2, hosterrorstring1, sizeof(hosterrorstring2));
CL_Parse_DumpPacket();
if (ext && (!strcmp(ext, "tga") || !strcmp(ext, "pcx") || !strcmp(ext, "lmp") || !strcmp(ext, "png") || !strcmp(ext, "jpg") || !strcmp(ext, "wal")))
FS_StripExtension(in, out, size_out);
else
- strlcpy(out, in, size_out);
+ dp_strlcpy(out, in, size_out);
}
static unsigned char image_linearfromsrgb[256];
*c = '#';
path[0] = 0;
name[0] = 0;
- strlcpy(afterpath, basename, sizeof(afterpath));
+ dp_strlcpy(afterpath, basename, sizeof(afterpath));
if (strchr(basename, '/'))
{
int i;
for (i = 0;i < (int)sizeof(path)-1 && basename[i] != '/' && basename[i];i++)
path[i] = basename[i];
path[i] = 0;
- strlcpy(afterpath, basename + i + 1, sizeof(afterpath));
+ dp_strlcpy(afterpath, basename + i + 1, sizeof(afterpath));
}
if (gamemode == GAME_TENEBRAE)
firstformat = imageformats_tenebrae;
return; // can't add this
i = (CompressedImageCacheItem*) Z_Malloc(sizeof(CompressedImageCacheItem));
- strlcpy(i->imagename, imagename, sizeof(i->imagename));
+ dp_strlcpy(i->imagename, imagename, sizeof(i->imagename));
i->maxsize = maxsize;
i->compressed = compressed;
i->compressed_size = compressed_size;
{
if (!history_matchfound)
return false;
- strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
key_linepos = (int)strlen(key_line);
history_matchfound = false;
return true;
static void Key_History_Up(void)
{
if(history_line == -1) // editing the "new" line
- strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
+ dp_strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
if (Key_History_Get_foundCommand())
return;
history_line = CONBUFFER_LINES_COUNT(&history) - 1;
if(history_line != -1)
{
- strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
key_linepos = (int)strlen(key_line);
}
}
else if(history_line > 0)
{
--history_line; // this also does -1 -> 0, so it is good
- strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
key_linepos = (int)strlen(key_line);
}
}
if(history_line < CONBUFFER_LINES_COUNT(&history) - 1)
{
++history_line;
- strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
}
else
{
history_line = -1;
- strlcpy(key_line + 1, history_savedline, sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, history_savedline, sizeof(key_line) - 1);
}
key_linepos = (int)strlen(key_line);
static void Key_History_First(void)
{
if(history_line == -1) // editing the "new" line
- strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
+ dp_strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
if (CONBUFFER_LINES_COUNT(&history) > 0)
{
history_line = 0;
- strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
key_linepos = (int)strlen(key_line);
}
}
static void Key_History_Last(void)
{
if(history_line == -1) // editing the "new" line
- strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
+ dp_strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
if (CONBUFFER_LINES_COUNT(&history) > 0)
{
history_line = CONBUFFER_LINES_COUNT(&history) - 1;
- strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
+ dp_strlcpy(key_line + 1, ConBuffer_GetLine(&history, history_line), sizeof(key_line) - 1);
key_linepos = (int)strlen(key_line);
}
}
size_t digits = strlen(va(vabuf, sizeof(vabuf), "%i", HIST_MAXLINES));
if (history_line == -1) // editing the "new" line
- strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
+ dp_strlcpy(history_savedline, key_line + 1, sizeof(history_savedline));
if (strcmp(key_line + 1, history_searchstring)) // different string? Start a new search
{
- strlcpy(history_searchstring, key_line + 1, sizeof(history_searchstring));
+ dp_strlcpy(history_searchstring, key_line + 1, sizeof(history_searchstring));
i = CONBUFFER_LINES_COUNT(&history) - 1;
}
else if (history_line == -1)
if (strcmp(key_line + 1, history_searchstring)) // different string? Start a new search
{
- strlcpy(history_searchstring, key_line + 1, sizeof(history_searchstring));
+ dp_strlcpy(history_searchstring, key_line + 1, sizeof(history_searchstring));
i = 0;
}
else i = history_line + 1;
{
// hide ']' from u8_prevbyte otherwise it could go out of bounds
int newpos = (int)u8_prevbyte(line + linestart, linepos - linestart) + linestart;
- strlcpy(line + newpos, line + linepos, linesize + 1 - linepos);
+ dp_strlcpy(line + newpos, line + linepos, linesize + 1 - linepos);
linepos = newpos;
}
return linepos;
// copy the rest of the command line
line[0] = 0; // start out with a null string
for (i = 3; i < c; i++) {
- strlcat (line, Cmd_Argv(cmd, i), sizeof (line));
+ dp_strlcat (line, Cmd_Argv(cmd, i), sizeof (line));
if (i != (c - 1))
- strlcat (line, " ", sizeof (line));
+ dp_strlcat (line, " ", sizeof (line));
}
if(!Key_SetBinding (b, m, line))
// copy the rest of the command line
line[0] = 0; // start out with a null string
for (i = 2; i < c; i++) {
- strlcat (line, Cmd_Argv(cmd, i), sizeof (line));
+ dp_strlcat (line, Cmd_Argv(cmd, i), sizeof (line));
if (i != (c - 1))
- strlcat (line, " ", sizeof (line));
+ dp_strlcat (line, " ", sizeof (line));
}
if(!Key_SetBinding (b, 0, line))
if(!curl_dll)
return;
if(cmd)
- strlcpy(command_when_done, cmd, sizeof(command_when_done));
+ dp_strlcpy(command_when_done, cmd, sizeof(command_when_done));
else
*command_when_done = 0;
}
if(!curl_dll)
return;
if(cmd)
- strlcpy(command_when_error, cmd, sizeof(command_when_error));
+ dp_strlcpy(command_when_error, cmd, sizeof(command_when_error));
else
*command_when_error = 0;
}
break;
}
if(content_type_)
- strlcpy(content_type, content_type_, sizeof(content_type));
+ dp_strlcpy(content_type, content_type_, sizeof(content_type));
else
*content_type = 0;
if(forthismap)
++numdownloads_added;
di = (downloadinfo *) Z_Malloc(sizeof(*di));
- strlcpy(di->filename, name, sizeof(di->filename));
- strlcpy(di->url, URL, sizeof(di->url));
+ dp_strlcpy(di->filename, name, sizeof(di->filename));
+ dp_strlcpy(di->url, URL, sizeof(di->url));
dpsnprintf(di->referer, sizeof(di->referer), "dp://%s/", cls.netcon ? cls.netcon->address : "notconnected.invalid");
di->forthismap = forthismap;
di->stream = NULL;
if(developer.integer <= 0)
if(di->buffer)
continue;
- strlcpy(downinfo[i].filename, di->filename, sizeof(downinfo[i].filename));
+ dp_strlcpy(downinfo[i].filename, di->filename, sizeof(downinfo[i].filename));
if(di->curle)
{
downinfo[i].progress = Curl_GetDownloadAmount(di);
*urlend = 0;
if(matchpattern(filename, pattern, true))
{
- strlcpy(foundurl, url, sizeof(foundurl));
+ dp_strlcpy(foundurl, url, sizeof(foundurl));
Z_Free(buf);
return foundurl;
}
{
requirement *req = (requirement *) Z_Malloc(sizeof(*requirements));
req->next = requirements;
- strlcpy(req->filename, filename, sizeof(req->filename));
+ dp_strlcpy(req->filename, filename, sizeof(req->filename));
requirements = req;
}
if(packurl && *packurl && strcmp(packurl, "-"))
{
if(!foundone)
- strlcat(sendbuffer, "curl --clear_autodownload\n", sendbuffer_len);
+ dp_strlcat(sendbuffer, "curl --clear_autodownload\n", sendbuffer_len);
- strlcat(sendbuffer, "curl --pak --forthismap --as ", sendbuffer_len);
- strlcat(sendbuffer, thispack, sendbuffer_len);
+ dp_strlcat(sendbuffer, "curl --pak --forthismap --as ", sendbuffer_len);
+ dp_strlcat(sendbuffer, thispack, sendbuffer_len);
if(sv_curl_maxspeed.value > 0)
dpsnprintf(sendbuffer + strlen(sendbuffer), sendbuffer_len - strlen(sendbuffer), " --maxspeed=%.1f", sv_curl_maxspeed.value);
- strlcat(sendbuffer, " --for ", sendbuffer_len);
- strlcat(sendbuffer, filename, sendbuffer_len);
- strlcat(sendbuffer, " ", sendbuffer_len);
- strlcat(sendbuffer, packurl, sendbuffer_len);
- strlcat(sendbuffer, thispack, sendbuffer_len);
- strlcat(sendbuffer, "\n", sendbuffer_len);
+ dp_strlcat(sendbuffer, " --for ", sendbuffer_len);
+ dp_strlcat(sendbuffer, filename, sendbuffer_len);
+ dp_strlcat(sendbuffer, " ", sendbuffer_len);
+ dp_strlcat(sendbuffer, packurl, sendbuffer_len);
+ dp_strlcat(sendbuffer, thispack, sendbuffer_len);
+ dp_strlcat(sendbuffer, "\n", sendbuffer_len);
return true;
}
foundone = Curl_SendRequirement(com_token, foundone, sendbuffer, sizeof(sendbuffer)) || foundone;
if(foundone)
- strlcat(sendbuffer, "curl --finish_autodownload\n", sizeof(sendbuffer));
+ dp_strlcat(sendbuffer, "curl --finish_autodownload\n", sizeof(sendbuffer));
if(strlen(sendbuffer) + 1 < sizeof(sendbuffer))
SV_ClientCommands("%s", sendbuffer);
for (i=0 ; i<MAX_SAVEGAMES ; i++)
{
- strlcpy (m_filenames[i], "--- UNUSED SLOT ---", sizeof(m_filenames[i]));
+ dp_strlcpy (m_filenames[i], "--- UNUSED SLOT ---", sizeof(m_filenames[i]));
loadable[i] = false;
dpsnprintf (name, sizeof(name), "s%i.sav", (int)i);
f = FS_OpenRealFile (name, "rb", false);
//version = atoi(com_token);
// description
COM_ParseToken_Simple(&t, false, false, true);
- strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
+ dp_strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));
// change _ back to space
for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
key_dest = key_menu;
m_state = m_setup;
m_entersound = true;
- strlcpy(setup_myname, cl_name.string, sizeof(setup_myname));
+ dp_strlcpy(setup_myname, cl_name.string, sizeof(setup_myname));
setup_top = setup_oldtop = cl_topcolor.integer;
setup_bottom = setup_oldbottom = cl_bottomcolor.integer;
setup_rate = cl_rate.integer;
// LadyHavoc: redesigned to print more than 2 keys, inspired by Tomaz's MiniRacer
if (keys[0] == -1)
- strlcpy(keystring, "???", sizeof(keystring));
+ dp_strlcpy(keystring, "???", sizeof(keystring));
else
{
char tinystr[TINYSTR_LEN];
if (keys[j] != -1)
{
if (j > 0)
- strlcat(keystring, " or ", sizeof(keystring));
- strlcat(keystring, Key_KeynumToString (keys[j], tinystr, TINYSTR_LEN), sizeof(keystring));
+ dp_strlcat(keystring, " or ", sizeof(keystring));
+ dp_strlcat(keystring, Key_KeynumToString (keys[j], tinystr, TINYSTR_LEN), sizeof(keystring));
}
}
}
description = FS_CheckGameDir(list.strings[i]);
if (description == NULL || description == fs_checkgamedir_missing) continue;
- strlcpy (modlist[modlist_count].dir, list.strings[i], sizeof(modlist[modlist_count].dir));
+ dp_strlcpy (modlist[modlist_count].dir, list.strings[i], sizeof(modlist[modlist_count].dir));
//check currently loaded mods
modlist[modlist_count].loaded = false;
if (fs_numgamedirs)
// copy our mod list into an array for FS_ChangeGameDirs
numgamedirs = modlist_numenabled;
for (i = 0; i < modlist_numenabled; i++)
- strlcpy (gamedirs[i], modlist[modlist_enabled[i]].dir,sizeof (gamedirs[i]));
+ dp_strlcpy (gamedirs[i], modlist[modlist_enabled[i]].dir,sizeof (gamedirs[i]));
// this code snippet is from FS_ChangeGameDirs
if (fs_numgamedirs == numgamedirs)
// get scene name from first frame
pinframe = (daliasframe_t *)datapointer;
- strlcpy(scene->name, pinframe->name, sizeof(scene->name));
+ dp_strlcpy(scene->name, pinframe->name, sizeof(scene->name));
scene->firstframe = pose;
scene->framecount = groupframes;
scene->framerate = 1.0f / interval;
// store the info about the new skin
Mod_LoadCustomMaterial(loadmodel->mempool, loadmodel->data_textures + totalskins * loadmodel->num_surfaces, name, SUPERCONTENTS_SOLID, MATERIALFLAG_WALL, tempskinframe);
- strlcpy(loadmodel->skinscenes[loadmodel->numskins].name, name, sizeof(loadmodel->skinscenes[loadmodel->numskins].name));
+ dp_strlcpy(loadmodel->skinscenes[loadmodel->numskins].name, name, sizeof(loadmodel->skinscenes[loadmodel->numskins].name));
loadmodel->skinscenes[loadmodel->numskins].firstframe = totalskins;
loadmodel->skinscenes[loadmodel->numskins].framecount = 1;
loadmodel->skinscenes[loadmodel->numskins].framerate = 10.0f;
out[k] = v[vertremap[k]];
datapointer += numxyz * sizeof(trivertx_t);
- strlcpy(loadmodel->animscenes[i].name, pinframe->name, sizeof(loadmodel->animscenes[i].name));
+ dp_strlcpy(loadmodel->animscenes[i].name, pinframe->name, sizeof(loadmodel->animscenes[i].name));
loadmodel->animscenes[i].firstframe = i;
loadmodel->animscenes[i].framecount = 1;
loadmodel->animscenes[i].framerate = 10;
loadmodel->animscenes = (animscene_t *)Mem_Alloc(loadmodel->mempool, loadmodel->numframes * sizeof(animscene_t));
for (i = 0, pinframe = (md3frameinfo_t *)((unsigned char *)pinmodel + LittleLong(pinmodel->lump_frameinfo));i < loadmodel->numframes;i++, pinframe++)
{
- strlcpy(loadmodel->animscenes[i].name, pinframe->name, sizeof(loadmodel->animscenes[i].name));
+ dp_strlcpy(loadmodel->animscenes[i].name, pinframe->name, sizeof(loadmodel->animscenes[i].name));
loadmodel->animscenes[i].firstframe = i;
loadmodel->animscenes[i].framecount = 1;
loadmodel->animscenes[i].framerate = 10;
loadmodel->data_tags = (aliastag_t *)Mem_Alloc(loadmodel->mempool, loadmodel->num_tagframes * loadmodel->num_tags * sizeof(aliastag_t));
for (i = 0, pintag = (md3tag_t *)((unsigned char *)pinmodel + LittleLong(pinmodel->lump_tags));i < loadmodel->num_tagframes * loadmodel->num_tags;i++, pintag++)
{
- strlcpy(loadmodel->data_tags[i].name, pintag->name, sizeof(loadmodel->data_tags[i].name));
+ dp_strlcpy(loadmodel->data_tags[i].name, pintag->name, sizeof(loadmodel->data_tags[i].name));
for (j = 0;j < 9;j++)
loadmodel->data_tags[i].matrixgl[j] = LittleFloat(pintag->rotationmatrix[j]);
for (j = 0;j < 3;j++)
loadmodel->synctype = ST_RAND;
FS_StripExtension(loadmodel->name, animname, sizeof(animname));
- strlcat(animname, ".psa", sizeof(animname));
+ dp_strlcat(animname, ".psa", sizeof(animname));
animbuffer = animfilebuffer = FS_LoadFile(animname, loadmodel->mempool, false, &filesize);
animbufferend = (void *)((unsigned char*)animbuffer + (int)filesize);
if (!animbuffer)
// copy over the bones
for (index = 0;index < numbones;index++)
{
- strlcpy(loadmodel->data_bones[index].name, bones[index].name, sizeof(loadmodel->data_bones[index].name));
+ dp_strlcpy(loadmodel->data_bones[index].name, bones[index].name, sizeof(loadmodel->data_bones[index].name));
loadmodel->data_bones[index].parent = (index || bones[index].parent > 0) ? bones[index].parent : -1;
if (loadmodel->data_bones[index].parent >= index)
Host_Error("%s bone[%i].parent >= %i", loadmodel->name, index, index);
}
else
{
- strlcpy(loadmodel->animscenes[0].name, "base", sizeof(loadmodel->animscenes[0].name));
+ dp_strlcpy(loadmodel->animscenes[0].name, "base", sizeof(loadmodel->animscenes[0].name));
loadmodel->animscenes[0].firstframe = 0;
loadmodel->animscenes[0].framecount = 1;
loadmodel->animscenes[0].loop = true;
joint1[i].rotation[j] = LittleFloat(injoint1[i].rotation[j]);
joint1[i].scale[j] = LittleFloat(injoint1[i].scale[j]);
}
- strlcpy(loadmodel->data_bones[i].name, &text[joint1[i].name], sizeof(loadmodel->data_bones[i].name));
+ dp_strlcpy(loadmodel->data_bones[i].name, &text[joint1[i].name], sizeof(loadmodel->data_bones[i].name));
loadmodel->data_bones[i].parent = joint1[i].parent;
if (loadmodel->data_bones[i].parent >= i)
Host_Error("%s bone[%i].parent >= %i", loadmodel->name, i, i);
joint[i].scale[j] = LittleFloat(injoint[i].scale[j]);
}
joint[i].rotation[3] = LittleFloat(injoint[i].rotation[3]);
- strlcpy(loadmodel->data_bones[i].name, &text[joint[i].name], sizeof(loadmodel->data_bones[i].name));
+ dp_strlcpy(loadmodel->data_bones[i].name, &text[joint[i].name], sizeof(loadmodel->data_bones[i].name));
loadmodel->data_bones[i].parent = joint[i].parent;
if (loadmodel->data_bones[i].parent >= i)
Host_Error("%s bone[%i].parent >= %i", loadmodel->name, i, i);
anim.num_frames = LittleLong(anims[i].num_frames);
anim.framerate = LittleFloat(anims[i].framerate);
anim.flags = LittleLong(anims[i].flags);
- strlcpy(loadmodel->animscenes[i].name, &text[anim.name], sizeof(loadmodel->animscenes[i].name));
+ dp_strlcpy(loadmodel->animscenes[i].name, &text[anim.name], sizeof(loadmodel->animscenes[i].name));
loadmodel->animscenes[i].firstframe = anim.first_frame;
loadmodel->animscenes[i].framecount = anim.num_frames;
loadmodel->animscenes[i].loop = ((anim.flags & IQM_LOOP) != 0);
}
if (header.num_anims <= 0)
{
- strlcpy(loadmodel->animscenes[0].name, "static", sizeof(loadmodel->animscenes[0].name));
+ dp_strlcpy(loadmodel->animscenes[0].name, "static", sizeof(loadmodel->animscenes[0].name));
loadmodel->animscenes[0].firstframe = 0;
loadmodel->animscenes[0].framecount = 1;
loadmodel->animscenes[0].loop = true;
Cvar_SetQuick(&mod_q3shader_force_addalpha, "1");
memset(&mod_q1bsp_texture_solid, 0, sizeof(mod_q1bsp_texture_solid));
- strlcpy(mod_q1bsp_texture_solid.name, "solid" , sizeof(mod_q1bsp_texture_solid.name));
+ dp_strlcpy(mod_q1bsp_texture_solid.name, "solid" , sizeof(mod_q1bsp_texture_solid.name));
mod_q1bsp_texture_solid.surfaceflags = 0;
mod_q1bsp_texture_solid.supercontents = SUPERCONTENTS_SOLID;
mod_q1bsp_texture_sky = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_sky.name, "sky", sizeof(mod_q1bsp_texture_sky.name));
+ dp_strlcpy(mod_q1bsp_texture_sky.name, "sky", sizeof(mod_q1bsp_texture_sky.name));
mod_q1bsp_texture_sky.surfaceflags = Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NOIMPACT | Q3SURFACEFLAG_NOMARKS | Q3SURFACEFLAG_NODLIGHT | Q3SURFACEFLAG_NOLIGHTMAP;
mod_q1bsp_texture_sky.supercontents = SUPERCONTENTS_SKY | SUPERCONTENTS_NODROP;
mod_q1bsp_texture_lava = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_lava.name, "*lava", sizeof(mod_q1bsp_texture_lava.name));
+ dp_strlcpy(mod_q1bsp_texture_lava.name, "*lava", sizeof(mod_q1bsp_texture_lava.name));
mod_q1bsp_texture_lava.surfaceflags = Q3SURFACEFLAG_NOMARKS;
mod_q1bsp_texture_lava.supercontents = SUPERCONTENTS_LAVA | SUPERCONTENTS_NODROP;
mod_q1bsp_texture_slime = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_slime.name, "*slime", sizeof(mod_q1bsp_texture_slime.name));
+ dp_strlcpy(mod_q1bsp_texture_slime.name, "*slime", sizeof(mod_q1bsp_texture_slime.name));
mod_q1bsp_texture_slime.surfaceflags = Q3SURFACEFLAG_NOMARKS;
mod_q1bsp_texture_slime.supercontents = SUPERCONTENTS_SLIME;
mod_q1bsp_texture_water = mod_q1bsp_texture_solid;
- strlcpy(mod_q1bsp_texture_water.name, "*water", sizeof(mod_q1bsp_texture_water.name));
+ dp_strlcpy(mod_q1bsp_texture_water.name, "*water", sizeof(mod_q1bsp_texture_water.name));
mod_q1bsp_texture_water.surfaceflags = Q3SURFACEFLAG_NOMARKS;
mod_q1bsp_texture_water.supercontents = SUPERCONTENTS_WATER;
}
skinframemissing = R_SkinFrame_LoadMissing();
for (i = 0, tx = loadmodel->data_textures;i < loadmodel->num_textures;i++, tx++)
{
- strlcpy(tx->name, "NO TEXTURE FOUND", sizeof(tx->name));
+ dp_strlcpy(tx->name, "NO TEXTURE FOUND", sizeof(tx->name));
tx->width = 16;
tx->height = 16;
tx->basealpha = 1.0f;
// no luck with loading shaders or external textures - restore the in-progress texture loading
loadmodel->data_textures[i] = backuptex;
- strlcpy(tx->name, name, sizeof(tx->name));
+ dp_strlcpy(tx->name, name, sizeof(tx->name));
tx->width = mtwidth;
tx->height = mtheight;
tx->basealpha = 1.0f;
else // LadyHavoc: bsp version 29 (normal white lighting)
{
// LadyHavoc: hope is not lost yet, check for a .lit file to load
- strlcpy (litfilename, loadmodel->name, sizeof (litfilename));
+ dp_strlcpy (litfilename, loadmodel->name, sizeof (litfilename));
FS_StripExtension (litfilename, litfilename, sizeof (litfilename));
- strlcpy (dlitfilename, litfilename, sizeof (dlitfilename));
- strlcat (litfilename, ".lit", sizeof (litfilename));
- strlcat (dlitfilename, ".dlit", sizeof (dlitfilename));
+ dp_strlcpy (dlitfilename, litfilename, sizeof (dlitfilename));
+ dp_strlcat (litfilename, ".lit", sizeof (litfilename));
+ dp_strlcat (dlitfilename, ".dlit", sizeof (dlitfilename));
data = (unsigned char*) FS_LoadFile(litfilename, tempmempool, false, &filesize);
if (data)
{
if (com_token[0] == '}')
break; // end of worldspawn
if (com_token[0] == '_')
- strlcpy(key, com_token + 1, sizeof(key));
+ dp_strlcpy(key, com_token + 1, sizeof(key));
else
- strlcpy(key, com_token, sizeof(key));
+ dp_strlcpy(key, com_token, sizeof(key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
if (!COM_ParseToken_Simple(&data, false, false, true))
// copy the base model to this one
*mod = *loadmodel;
// rename the clone back to its proper name
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
mod->brush.parentmodel = loadmodel;
// textures and memory belong to the main model
mod->texturepool = NULL;
// copy the base model to this one
*mod = *loadmodel;
// rename the clone back to its proper name
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
mod->brush.parentmodel = loadmodel;
// textures and memory belong to the main model
mod->texturepool = NULL;
if (com_token[0] == '}')
break; // end of worldspawn
if (com_token[0] == '_')
- strlcpy(key, com_token + 1, sizeof(key));
+ dp_strlcpy(key, com_token + 1, sizeof(key));
else
- strlcpy(key, com_token, sizeof(key));
+ dp_strlcpy(key, com_token, sizeof(key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
if (!COM_ParseToken_Simple(&data, false, false, true))
break; // error
- strlcpy(value, com_token, sizeof(value));
+ dp_strlcpy(value, com_token, sizeof(value));
if (!strcasecmp("gridsize", key)) // this one is case insensitive to 100% match q3map2
{
#if _MSC_VER >= 1400
for (i = 0;i < count;i++, in++, out++)
{
- strlcpy (out->shadername, in->shadername, sizeof (out->shadername));
+ dp_strlcpy (out->shadername, in->shadername, sizeof (out->shadername));
n = LittleLong(in->brushindex);
if (n >= loadmodel->brush.num_brushes)
{
// copy the base model to this one
*mod = *loadmodel;
// rename the clone back to its proper name
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
mod->brush.parentmodel = loadmodel;
// textures and memory belong to the main model
mod->texturepool = NULL;
texturenames = (char *)Mem_Realloc(loadmodel->mempool, texturenames, maxtextures * MAX_QPATH);
}
textureindex = numtextures++;
- strlcpy(texturenames + textureindex*MAX_QPATH, loadmodel->name, MAX_QPATH);
+ dp_strlcpy(texturenames + textureindex*MAX_QPATH, loadmodel->name, MAX_QPATH);
}
for (j = 1;j < argc;j++)
{
texturenames = (char *)Mem_Realloc(loadmodel->mempool, texturenames, maxtextures * MAX_QPATH);
}
textureindex = numtextures++;
- strlcpy(texturenames + textureindex*MAX_QPATH, argv[1], MAX_QPATH);
+ dp_strlcpy(texturenames + textureindex*MAX_QPATH, argv[1], MAX_QPATH);
}
}
}
// copy the base model to this one
*mod = *loadmodel;
// rename the clone back to its proper name
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
mod->brush.parentmodel = loadmodel;
// textures and memory belong to the main model
mod->texturepool = NULL;
if (developer_loading.integer)
Con_Printf("unloading model %s\n", mod->name);
- strlcpy(name, mod->name, sizeof(name));
+ dp_strlcpy(name, mod->name, sizeof(name));
parentmodel = mod->brush.parentmodel;
used = mod->used;
if (mod->mempool)
// clear the struct to make it available
memset(mod, 0, sizeof(model_t));
// restore the fields we want to preserve
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
mod->brush.parentmodel = parentmodel;
mod->used = used;
mod->loaded = false;
name[0] = 0;
if (bufptr && strcmp(com_token, "\n"))
{
- strlcpy(name, com_token, sizeof(name));
+ dp_strlcpy(name, com_token, sizeof(name));
COM_ParseToken_Simple(&bufptr, true, false, true);
}
model_t *mod = (model_t *) pass;
animscene_t *anim = &mod->animscenes[i];
if(name)
- strlcpy(anim->name, name, sizeof(anim[i].name));
+ dp_strlcpy(anim->name, name, sizeof(anim[i].name));
else
dpsnprintf(anim->name, sizeof(anim[i].name), "groupified_%d_anim", i);
anim->firstframe = bound(0, start, mod->num_poses - 1);
// no match found, create a new one
mod = (model_t *) Mem_ExpandableArray_AllocRecord(&models);
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
if (parentname[0])
mod->brush.parentmodel = Mod_FindName(parentname, NULL);
else
// name
j = (int)strlen(com_token)+1;
custsurfaceparmnames[numcustsurfaceflags] = (char *)Mem_Alloc(tempmempool, j);
- strlcpy(custsurfaceparmnames[numcustsurfaceflags], com_token, j+1);
+ dp_strlcpy(custsurfaceparmnames[numcustsurfaceflags], com_token, j+1);
// value
if (COM_ParseToken_QuakeC(&text, false))
custsurfaceflags[numcustsurfaceflags] = strtol(com_token, NULL, 0);
// WHEN ADDING DEFAULTS HERE, REMEMBER TO PUT DEFAULTS IN ALL LOADERS
// JUST GREP FOR "specularscalemod = 1".
- strlcpy(shader.name, com_token, sizeof(shader.name));
+ dp_strlcpy(shader.name, com_token, sizeof(shader.name));
if (!COM_ParseToken_QuakeC(&text, false) || strcasecmp(com_token, "{"))
{
Con_DPrintf("%s parsing error - expected \"{\", found \"%s\"\n", search->filenames[fileindex], com_token);
if(j == 0 && !strncasecmp(com_token, "dp_", 3))
dpsnprintf(parameter[j], sizeof(parameter[j]), "dp%s", &com_token[3]);
else
- strlcpy(parameter[j], com_token, sizeof(parameter[j]));
+ dp_strlcpy(parameter[j], com_token, sizeof(parameter[j]));
numparameters = j + 1;
}
if (!COM_ParseToken_QuakeC(&text, true))
if(j == 0 && !strncasecmp(com_token, "dp_", 3))
dpsnprintf(parameter[j], sizeof(parameter[j]), "dp%s", &com_token[3]);
else
- strlcpy(parameter[j], com_token, sizeof(parameter[j]));
+ dp_strlcpy(parameter[j], com_token, sizeof(parameter[j]));
numparameters = j + 1;
}
if (!COM_ParseToken_QuakeC(&text, true))
else if (!strcasecmp(parameter[0], "dpnortlight"))
shader.dpnortlight = true;
else if (!strcasecmp(parameter[0], "dpreflectcube"))
- strlcpy(shader.dpreflectcube, parameter[1], sizeof(shader.dpreflectcube));
+ dp_strlcpy(shader.dpreflectcube, parameter[1], sizeof(shader.dpreflectcube));
else if (!strcasecmp(parameter[0], "dpmeshcollisions"))
shader.dpmeshcollisions = true;
// this sets dpshaderkill to true if dpshaderkillifcvarzero was used, and to false if dpnoshaderkillifcvarzero was used
{
// some q3 skies don't have the sky parm set
shader.surfaceparms |= Q3SURFACEPARM_SKY;
- strlcpy(shader.skyboxname, parameter[1], sizeof(shader.skyboxname));
+ dp_strlcpy(shader.skyboxname, parameter[1], sizeof(shader.skyboxname));
}
else if (!strcasecmp(parameter[0], "skyparms") && numparameters >= 2)
{
// some q3 skies don't have the sky parm set
shader.surfaceparms |= Q3SURFACEPARM_SKY;
if (!atoi(parameter[1]) && strcasecmp(parameter[1], "-"))
- strlcpy(shader.skyboxname, parameter[1], sizeof(shader.skyboxname));
+ dp_strlcpy(shader.skyboxname, parameter[1], sizeof(shader.skyboxname));
}
else if (!strcasecmp(parameter[0], "cull") && numparameters >= 2)
{
shader_t *shader;
if (!name)
name = "";
- strlcpy(texture->name, name, sizeof(texture->name));
+ dp_strlcpy(texture->name, name, sizeof(texture->name));
texture->basealpha = 1.0f;
shader = name[0] ? Mod_LookupQ3Shader(name) : NULL;
if (!(materialflags & (MATERIALFLAG_WALL | MATERIALFLAG_SKY)))
Con_DPrintf("^1Custom texture ^3\"%s\" does not have MATERIALFLAG_WALL set\n", texture->name);
- strlcpy(texture->name, name, sizeof(texture->name));
+ dp_strlcpy(texture->name, name, sizeof(texture->name));
texture->basealpha = 1.0f;
texture->basematerialflags = materialflags;
texture->supercontents = supercontents;
do
{
if (words < 10)
- strlcpy(word[words++], com_token, sizeof (word[0]));
+ dp_strlcpy(word[words++], com_token, sizeof (word[0]));
else
wordsoverflow = true;
}
skinfileitem = (skinfileitem_t *)Mem_Alloc(loadmodel->mempool, sizeof(skinfileitem_t));
skinfileitem->next = skinfile->items;
skinfile->items = skinfileitem;
- strlcpy (skinfileitem->name, word[1], sizeof (skinfileitem->name));
- strlcpy (skinfileitem->replacement, word[2], sizeof (skinfileitem->replacement));
+ dp_strlcpy (skinfileitem->name, word[1], sizeof (skinfileitem->name));
+ dp_strlcpy (skinfileitem->replacement, word[2], sizeof (skinfileitem->replacement));
}
else
Con_Printf("Mod_LoadSkinFiles: parsing error in file \"%s_%i.skin\" on line #%i: wrong number of parameters to command \"%s\", see documentation in DP_GFX_SKINFILES extension in dpextensions.qc\n", loadmodel->name, i, line, word[0]);
skinfileitem = (skinfileitem_t *)Mem_Alloc(loadmodel->mempool, sizeof(skinfileitem_t));
skinfileitem->next = skinfile->items;
skinfile->items = skinfileitem;
- strlcpy (skinfileitem->name, word[0], sizeof (skinfileitem->name));
- strlcpy (skinfileitem->replacement, word[2], sizeof (skinfileitem->replacement));
+ dp_strlcpy (skinfileitem->name, word[0], sizeof (skinfileitem->name));
+ dp_strlcpy (skinfileitem->replacement, word[2], sizeof (skinfileitem->replacement));
}
else
Con_Printf("Mod_LoadSkinFiles: parsing error in file \"%s_%i.skin\" on line #%i: does not look like tag or mesh specification, or replace command, see documentation in DP_GFX_SKINFILES extension in dpextensions.qc\n", loadmodel->name, i, line);
if (textureindex >= maxtextures)
continue; // just a precaution
textureindex = counttextures++;
- strlcpy(texturenames + textureindex * MAX_QPATH, texname, MAX_QPATH);
+ dp_strlcpy(texturenames + textureindex * MAX_QPATH, texname, MAX_QPATH);
if (outbufferpos >= outbuffermax >> 1)
{
outbuffermax *= 2;
return;
}
- strlcpy(inname, Cmd_Argv(cmd, 1), sizeof(inname));
+ dp_strlcpy(inname, Cmd_Argv(cmd, 1), sizeof(inname));
FS_StripExtension(inname, basename, sizeof(basename));
mod = Mod_ForName(inname, false, true, inname[0] == '*' ? cl.model_name[1] : NULL);
if (l > 0) dpmtextsize += l;
for (i = 0;i < mod->numframes;i = j)
{
- strlcpy(animname, mod->animscenes[i].name, sizeof(animname));
+ dp_strlcpy(animname, mod->animscenes[i].name, sizeof(animname));
first = mod->animscenes[i].firstframe;
if (mod->animscenes[i].framecount > 1)
{
count = mod->num_poses - first;
for (j = i + 1;j < mod->numframes;j++)
{
- strlcpy(animname2, mod->animscenes[j].name, sizeof(animname2));
+ dp_strlcpy(animname2, mod->animscenes[j].name, sizeof(animname2));
for (l = 0, k = (int)strlen(animname2);animname2[l];l++)
if(animname2[l] < '0' || animname2[l] > '9')
k = l + 1;
}
// if it's only one frame, use the original frame name
if (j == i + 1)
- strlcpy(animname, mod->animscenes[i].name, sizeof(animname));
+ dp_strlcpy(animname, mod->animscenes[i].name, sizeof(animname));
}
dpsnprintf(outname, sizeof(outname), "%s_decompiled/%s.smd", basename, animname);
void Mod_Mesh_Create(model_t *mod, const char *name)
{
memset(mod, 0, sizeof(*mod));
- strlcpy(mod->name, name, sizeof(mod->name));
+ dp_strlcpy(mod->name, name, sizeof(mod->name));
mod->mempool = Mem_AllocPool(name, 0, NULL);
mod->texturepool = R_AllocTexturePool();
mod->Draw = R_Mod_Draw;
switch( field ) {
case SLIF_CNAME:
- strlcpy( mask->info.cname, str, sizeof(mask->info.cname) );
+ dp_strlcpy( mask->info.cname, str, sizeof(mask->info.cname) );
break;
case SLIF_NAME:
- strlcpy( mask->info.name, str, sizeof(mask->info.name) );
+ dp_strlcpy( mask->info.name, str, sizeof(mask->info.name) );
break;
case SLIF_QCSTATUS:
- strlcpy( mask->info.qcstatus, str, sizeof(mask->info.qcstatus) );
+ dp_strlcpy( mask->info.qcstatus, str, sizeof(mask->info.qcstatus) );
break;
case SLIF_PLAYERS:
- strlcpy( mask->info.players, str, sizeof(mask->info.players) );
+ dp_strlcpy( mask->info.players, str, sizeof(mask->info.players) );
break;
case SLIF_MAP:
- strlcpy( mask->info.map, str, sizeof(mask->info.map) );
+ dp_strlcpy( mask->info.map, str, sizeof(mask->info.map) );
break;
case SLIF_MOD:
- strlcpy( mask->info.mod, str, sizeof(mask->info.mod) );
+ dp_strlcpy( mask->info.mod, str, sizeof(mask->info.mod) );
break;
case SLIF_GAME:
- strlcpy( mask->info.game, str, sizeof(mask->info.game) );
+ dp_strlcpy( mask->info.game, str, sizeof(mask->info.game) );
break;
default:
VM_Warning(prog, "VM_M_setserverlistmaskstring: Bad field number %i passed!\n", field );
// currently 44 bytes, longest possible IPv6 address: 39 bytes, so this works
// (if v6 address contains port, it must start with '[')
{
- strlcpy(favorites_idfp[nFavorites_idfp], com_token, sizeof(favorites_idfp[nFavorites_idfp]));
+ dp_strlcpy(favorites_idfp[nFavorites_idfp], com_token, sizeof(favorites_idfp[nFavorites_idfp]));
++nFavorites_idfp;
}
else
CL_Disconnect();
// allocate a net connection to keep track of things
cls.netcon = NetConn_Open(mysocket, peeraddress);
- strlcpy(cl_connect_status, "Connection established", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Connection established", sizeof(cl_connect_status));
crypto = &cls.netcon->crypto;
if(cls.crypto.authenticated)
{
entry = &serverlist_cache[n];
memset(entry, 0, sizeof(*entry));
- strlcpy(entry->info.cname, addressstring, sizeof(entry->info.cname));
+ dp_strlcpy(entry->info.cname, addressstring, sizeof(entry->info.cname));
// use the broadcast as the first query, NetConn_QueryQueueFrame() will send more
entry->querytime = masterquerytime;
entry = &serverlist_cache[n];
memset(entry, 0, sizeof(*entry));
entry->protocol = protocol;
- strlcpy(entry->info.cname, ipstring, sizeof(entry->info.cname));
+ dp_strlcpy(entry->info.cname, ipstring, sizeof(entry->info.cname));
entry->info.isfavorite = isfavorite;
serverlist_cachecount++;
{
int k;
buf[45] = ' ';
- strlcpy(buf + 46, argbuf, sizeof(buf) - 46);
+ dp_strlcpy(buf + 46, argbuf, sizeof(buf) - 46);
NetConn_Write(mysocket, buf, 46 + (int)strlen(buf + 46), peeraddress);
cls.rcon_commands[i][0] = 0;
--cls.rcon_trying;
return true;
}
Con_DPrintf("\"%s\" received, sending connect request back to %s\n", string, addressstring2);
- strlcpy(cl_connect_status, "Connect: replying to challenge...", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Connect: replying to challenge...", sizeof(cl_connect_status));
Protocol_Names(protocolnames, sizeof(protocolnames));
// update the server IP in the userinfo (QW servers expect this, and it is used by the reconnect command)
else
Con_Printf("statusResponse without players block?\n");
- if ((s = InfoString_GetValue(string, "gamename" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->game, s, sizeof (info->game));
- if ((s = InfoString_GetValue(string, "modname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->mod , s, sizeof (info->mod ));
- if ((s = InfoString_GetValue(string, "mapname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->map , s, sizeof (info->map ));
- if ((s = InfoString_GetValue(string, "hostname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->name, s, sizeof (info->name));
+ if ((s = InfoString_GetValue(string, "gamename" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->game, s, sizeof (info->game));
+ if ((s = InfoString_GetValue(string, "modname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->mod , s, sizeof (info->mod ));
+ if ((s = InfoString_GetValue(string, "mapname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->map , s, sizeof (info->map ));
+ if ((s = InfoString_GetValue(string, "hostname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->name, s, sizeof (info->name));
if ((s = InfoString_GetValue(string, "protocol" , infostringvalue, sizeof(infostringvalue))) != NULL) info->protocol = atoi(s);
if ((s = InfoString_GetValue(string, "clients" , infostringvalue, sizeof(infostringvalue))) != NULL) info->numplayers = atoi(s);
if ((s = InfoString_GetValue(string, "bots" , infostringvalue, sizeof(infostringvalue))) != NULL) info->numbots = atoi(s);
if ((s = InfoString_GetValue(string, "sv_maxclients", infostringvalue, sizeof(infostringvalue))) != NULL) info->maxplayers = atoi(s);
if ((s = InfoString_GetValue(string, "gameversion" , infostringvalue, sizeof(infostringvalue))) != NULL) info->gameversion = atoi(s);
- if ((s = InfoString_GetValue(string, "qcstatus" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->qcstatus, s, sizeof(info->qcstatus));
- if (p != NULL) strlcpy(info->players, p, sizeof(info->players));
+ if ((s = InfoString_GetValue(string, "qcstatus" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->qcstatus, s, sizeof(info->qcstatus));
+ if (p != NULL) dp_strlcpy(info->players, p, sizeof(info->players));
info->numhumans = info->numplayers - max(0, info->numbots);
info->freeslots = info->maxplayers - info->numplayers;
info->maxplayers = 0;
info->gameversion = 0;
- if ((s = InfoString_GetValue(string, "gamename" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->game, s, sizeof (info->game));
- if ((s = InfoString_GetValue(string, "modname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->mod , s, sizeof (info->mod ));
- if ((s = InfoString_GetValue(string, "mapname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->map , s, sizeof (info->map ));
- if ((s = InfoString_GetValue(string, "hostname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->name, s, sizeof (info->name));
+ if ((s = InfoString_GetValue(string, "gamename" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->game, s, sizeof (info->game));
+ if ((s = InfoString_GetValue(string, "modname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->mod , s, sizeof (info->mod ));
+ if ((s = InfoString_GetValue(string, "mapname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->map , s, sizeof (info->map ));
+ if ((s = InfoString_GetValue(string, "hostname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->name, s, sizeof (info->name));
if ((s = InfoString_GetValue(string, "protocol" , infostringvalue, sizeof(infostringvalue))) != NULL) info->protocol = atoi(s);
if ((s = InfoString_GetValue(string, "clients" , infostringvalue, sizeof(infostringvalue))) != NULL) info->numplayers = atoi(s);
if ((s = InfoString_GetValue(string, "bots" , infostringvalue, sizeof(infostringvalue))) != NULL) info->numbots = atoi(s);
if ((s = InfoString_GetValue(string, "sv_maxclients", infostringvalue, sizeof(infostringvalue))) != NULL) info->maxplayers = atoi(s);
if ((s = InfoString_GetValue(string, "gameversion" , infostringvalue, sizeof(infostringvalue))) != NULL) info->gameversion = atoi(s);
- if ((s = InfoString_GetValue(string, "qcstatus" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->qcstatus, s, sizeof(info->qcstatus));
+ if ((s = InfoString_GetValue(string, "qcstatus" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->qcstatus, s, sizeof(info->qcstatus));
info->numhumans = info->numplayers - max(0, info->numbots);
info->freeslots = info->maxplayers - info->numplayers;
return true;
}
Con_DPrintf("challenge %s received, sending QuakeWorld connect request back to %s\n", string + 1, addressstring2);
- strlcpy(cl_connect_status, "Connect: replying to challenge...", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Connect: replying to challenge...", sizeof(cl_connect_status));
cls.qw_qport = qport.integer;
// update the server IP in the userinfo (QW servers expect this, and it is used by the reconnect command)
return true;
info = &serverlist_cache[n].info;
- strlcpy(info->game, "QuakeWorld", sizeof(info->game));
- if ((s = InfoString_GetValue(string, "*gamedir" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->mod , s, sizeof (info->mod ));else info->mod[0] = 0;
- if ((s = InfoString_GetValue(string, "map" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->map , s, sizeof (info->map ));else info->map[0] = 0;
- if ((s = InfoString_GetValue(string, "hostname" , infostringvalue, sizeof(infostringvalue))) != NULL) strlcpy(info->name, s, sizeof (info->name));else info->name[0] = 0;
+ dp_strlcpy(info->game, "QuakeWorld", sizeof(info->game));
+ if ((s = InfoString_GetValue(string, "*gamedir" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->mod , s, sizeof (info->mod ));else info->mod[0] = 0;
+ if ((s = InfoString_GetValue(string, "map" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->map , s, sizeof (info->map ));else info->map[0] = 0;
+ if ((s = InfoString_GetValue(string, "hostname" , infostringvalue, sizeof(infostringvalue))) != NULL) dp_strlcpy(info->name, s, sizeof (info->name));else info->name[0] = 0;
info->protocol = 0;
info->numplayers = 0; // updated below
info->numhumans = 0; // updated below
break;
info = &serverlist_cache[n].info;
- strlcpy(info->game, "Quake", sizeof(info->game));
- strlcpy(info->mod , "", sizeof(info->mod)); // mod name is not specified
- strlcpy(info->name, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(info->name));
- strlcpy(info->map , MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(info->map));
+ dp_strlcpy(info->game, "Quake", sizeof(info->game));
+ dp_strlcpy(info->mod , "", sizeof(info->mod)); // mod name is not specified
+ dp_strlcpy(info->name, MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(info->name));
+ dp_strlcpy(info->map , MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)), sizeof(info->map));
info->numplayers = MSG_ReadByte(&cl_message);
info->maxplayers = MSG_ReadByte(&cl_message);
info->protocol = MSG_ReadByte(&cl_message);
cls.connect_trying = false;
LHNETADDRESS_ToString(&cls.connect_address, address, sizeof(address), true);
- strlcpy(cl_connect_status, "Connect: failed, no reply", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "Connect: failed, no reply", sizeof(cl_connect_status));
Con_Printf(CON_ERROR "%s from %s\n", cl_connect_status, address);
return;
}
if (IS_NEXUIZ_DERIVED(gamemode) && (teamplay.integer > 0))
{
if(client->frags == -666) // spectator
- strlcpy(teambuf, " 0", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 0", sizeof(teambuf));
else if(client->colors == 0x44) // red team
- strlcpy(teambuf, " 1", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 1", sizeof(teambuf));
else if(client->colors == 0xDD) // blue team
- strlcpy(teambuf, " 2", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 2", sizeof(teambuf));
else if(client->colors == 0xCC) // yellow team
- strlcpy(teambuf, " 3", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 3", sizeof(teambuf));
else if(client->colors == 0x99) // pink team
- strlcpy(teambuf, " 4", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 4", sizeof(teambuf));
else
- strlcpy(teambuf, " 0", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 0", sizeof(teambuf));
}
else
*teambuf = 0;
while((userpass_end = strchr(userpass_start, ' ')))
{
have_usernames = true;
- strlcpy(buf, userpass_start, ((size_t)(userpass_end-userpass_start) >= sizeof(buf)) ? (int)(sizeof(buf)) : (int)(userpass_end-userpass_start+1));
+ dp_strlcpy(buf, userpass_start, ((size_t)(userpass_end-userpass_start) >= sizeof(buf)) ? (int)(sizeof(buf)) : (int)(userpass_end-userpass_start+1));
if(buf[0]) // Ignore empty entries due to leading/duplicate space.
if(comparator(peeraddress, buf, password, cs, cslen))
goto allow;
while((userpass_end = strchr(userpass_start, ' ')))
{
have_usernames = true;
- strlcpy(buf, userpass_start, ((size_t)(userpass_end-userpass_start) >= sizeof(buf)) ? (int)(sizeof(buf)) : (int)(userpass_end-userpass_start+1));
+ dp_strlcpy(buf, userpass_start, ((size_t)(userpass_end-userpass_start) >= sizeof(buf)) ? (int)(sizeof(buf)) : (int)(userpass_end-userpass_start+1));
if(buf[0]) // Ignore empty entries due to leading/duplicate space.
if(comparator(peeraddress, buf, password, cs, cslen))
goto check;
{
// connect to the client
// everything is allocated, just fill in the details
- strlcpy (conn->address, addressstring2, sizeof (conn->address));
+ dp_strlcpy (conn->address, addressstring2, sizeof (conn->address));
if (developer_extra.integer)
Con_DPrintf("Datagram_ParseConnectionless: sending CCREP_ACCEPT to %s.\n", addressstring2);
// send back the info about the server connection
char *s;
char *endpos;
const char *userlevel;
- strlcpy(password, MSG_ReadString(&sv_message, sv_readstring, sizeof(sv_readstring)), sizeof(password));
- strlcpy(cmd, MSG_ReadString(&sv_message, sv_readstring, sizeof(sv_readstring)), sizeof(cmd));
+ dp_strlcpy(password, MSG_ReadString(&sv_message, sv_readstring, sizeof(sv_readstring)), sizeof(password));
+ dp_strlcpy(cmd, MSG_ReadString(&sv_message, sv_readstring, sizeof(sv_readstring)), sizeof(cmd));
s = cmd;
endpos = cmd + strlen(cmd) + 1; // one behind the NUL, so adding strlen+1 will eventually reach it
userlevel = RCon_Authenticate(peeraddress, password, s, endpos, plaintext_matching, NULL, 0);
if (!masterquerycount)
{
Con_Print(CON_ERROR "Unable to query master servers, no suitable network sockets active.\n");
- strlcpy(cl_connect_status, "No network", sizeof(cl_connect_status));
+ dp_strlcpy(cl_connect_status, "No network", sizeof(cl_connect_status));
}
}
#endif
for (i = 0;protocolversioninfo[i].name;i++)
{
if (i > 0)
- strlcat(buffer, " ", buffersize);
- strlcat(buffer, protocolversioninfo[i].name, buffersize);
+ dp_strlcat(buffer, " ", buffersize);
+ dp_strlcat(buffer, protocolversioninfo[i].name, buffersize);
}
}
VM_SAFEPARMCOUNT(1,VM_tokenize);
- strlcpy(tokenize_string, PRVM_G_STRING(OFS_PARM0), sizeof(tokenize_string));
+ dp_strlcpy(tokenize_string, PRVM_G_STRING(OFS_PARM0), sizeof(tokenize_string));
p = tokenize_string;
num_tokens = 0;
VM_SAFEPARMCOUNT(1, VM_tokenize_console);
- strlcpy(tokenize_string, PRVM_G_STRING(OFS_PARM0), sizeof(tokenize_string));
+ dp_strlcpy(tokenize_string, PRVM_G_STRING(OFS_PARM0), sizeof(tokenize_string));
p = tokenize_string;
num_tokens = 0;
VM_SAFEPARMCOUNTRANGE(2, 8,VM_tokenizebyseparator);
- strlcpy(tokenize_string, PRVM_G_STRING(OFS_PARM0), sizeof(tokenize_string));
+ dp_strlcpy(tokenize_string, PRVM_G_STRING(OFS_PARM0), sizeof(tokenize_string));
p = tokenize_string;
numseparators = 0;
ret[0] = 0;
for(i = 0; i < FKFC_NUMKEYS; i++)
- strlcat(ret, va(vabuf, sizeof(vabuf), " \'%i\'", keys[i]), sizeof(ret));
+ dp_strlcat(ret, va(vabuf, sizeof(vabuf), " \'%i\'", keys[i]), sizeof(ret));
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, ret);
}
if( *in == '\'' || (*in == '\\' && !*++in) )
break;
- strlcpy(out, in, outstr + sizeof(outstr) - out);
+ dp_strlcpy(out, in, outstr + sizeof(outstr) - out);
PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString(prog, outstr );
}
for( ; *set ; *out++ = *set++ );
*out++ = '\'';
- strlcpy(out, in, outstr + sizeof(outstr) - out);
+ dp_strlcpy(out, in, outstr + sizeof(outstr) - out);
PRVM_G_INT( OFS_RETURN ) = PRVM_SetTempString(prog, outstr );
}
l += (i > 0 ? strlen(sep) : 0) + strlen(stringbuffer->strings[i]);
if (l >= sizeof(k) - 1)
break;
- strlcat(k, sep, sizeof(k));
- strlcat(k, stringbuffer->strings[i], sizeof(k));
+ dp_strlcat(k, sep, sizeof(k));
+ dp_strlcat(k, stringbuffer->strings[i], sizeof(k));
}
}
PRVM_G_INT(OFS_RETURN) = PRVM_SetTempString(prog, k);
match = PRVM_G_STRING(OFS_PARM1);
else
{
- strlcpy(string, PRVM_G_STRING(OFS_PARM1), sizeof(string));
+ dp_strlcpy(string, PRVM_G_STRING(OFS_PARM1), sizeof(string));
match = detect_match_rule(string, &matchrule);
}
matchlen = (int)strlen(match);
match = PRVM_G_STRING(OFS_PARM1);
else
{
- strlcpy(string, PRVM_G_STRING(OFS_PARM1), sizeof(string));
+ dp_strlcpy(string, PRVM_G_STRING(OFS_PARM1), sizeof(string));
match = detect_match_rule(string, &matchrule);
}
key = PRVM_G_STRING(OFS_PARM1);
VM_VarString(prog, 2, value, sizeof(value));
- strlcpy(temp, info, VM_STRINGTEMP_LENGTH);
+ dp_strlcpy(temp, info, VM_STRINGTEMP_LENGTH);
InfoString_SetValue(temp, VM_STRINGTEMP_LENGTH, key, value);
// POST: we sign postdata \0 query string
size_t ll;
handle->sigdata = (char *)Z_Malloc(8192);
- strlcpy(handle->sigdata, "X-D0-Blind-ID-Detached-Signature: ", 8192);
+ dp_strlcpy(handle->sigdata, "X-D0-Blind-ID-Detached-Signature: ", 8192);
l = strlen(handle->sigdata);
handle->siglen = Crypto_SignDataDetached(handle->postdata, handle->postlen + 1 + lq, postkeyid, handle->sigdata + l, 8192 - l);
if(!handle->siglen)
handle->sigdata[handle->siglen] = 0;
}
out1:
- strlcpy(handle->posttype, posttype, sizeof(handle->posttype));
+ dp_strlcpy(handle->posttype, posttype, sizeof(handle->posttype));
ret = Curl_Begin_ToMemory_POST(url, handle->sigdata, 0, handle->posttype, handle->postdata, handle->postlen, (unsigned char *) handle->buffer, sizeof(handle->buffer), uri_to_string_callback, handle);
}
else
// GET: we sign JUST the query string
size_t l, ll;
handle->sigdata = (char *)Z_Malloc(8192);
- strlcpy(handle->sigdata, "X-D0-Blind-ID-Detached-Signature: ", 8192);
+ dp_strlcpy(handle->sigdata, "X-D0-Blind-ID-Detached-Signature: ", 8192);
l = strlen(handle->sigdata);
handle->siglen = Crypto_SignDataDetached(query_string, lq, postkeyid, handle->sigdata + l, 8192 - l);
if(!handle->siglen)
switch (type)
{
case ev_string:
- strlcpy (line, PRVM_GetString (prog, val->string), linelength);
+ dp_strlcpy (line, PRVM_GetString (prog, val->string), linelength);
break;
case ev_entity:
n = val->edict;
if ((unsigned int)val->function < (unsigned int)prog->progs_numfunctions)
{
f = prog->functions + val->function;
- strlcpy (line, PRVM_GetString (prog, f->s_name), linelength);
+ dp_strlcpy (line, PRVM_GetString (prog, f->s_name), linelength);
}
else
dpsnprintf (line, linelength, "bad function %" PRVM_PRIi " (invalid!)", val->function);
tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
- strlcat(tempstring, name, sizeof(tempstring));
+ dp_strlcat(tempstring, name, sizeof(tempstring));
for (l = strlen(name);l < 14;l++)
- strlcat(tempstring, " ", sizeof(tempstring));
- strlcat(tempstring, " ", sizeof(tempstring));
+ dp_strlcat(tempstring, " ", sizeof(tempstring));
+ dp_strlcat(tempstring, " ", sizeof(tempstring));
name = PRVM_ValueString(prog, (etype_t)d->type, val, valuebuf, sizeof(valuebuf));
if (strlen(name) > sizeof(tempstring2)-4)
tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
- strlcat(tempstring, name, sizeof(tempstring));
- strlcat(tempstring, "\n", sizeof(tempstring));
+ dp_strlcat(tempstring, name, sizeof(tempstring));
+ dp_strlcat(tempstring, "\n", sizeof(tempstring));
if (strlen(tempstring) >= sizeof(tempstring)/2)
{
Con_Print(tempstring);
if (developer_entityparsing.integer)
Con_Printf("Key: \"%s\"", com_token);
- strlcpy (keyname, com_token, sizeof(keyname));
+ dp_strlcpy (keyname, com_token, sizeof(keyname));
// parse value
if (!COM_ParseToken_Simple(&data, false, true, true))
// and allow them to be turned into vectors. (FIXME...)
if (!strcmp(com_token, "angle"))
{
- strlcpy (com_token, "angles", sizeof(com_token));
+ dp_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"))
- strlcpy (com_token, "light_lev", sizeof(com_token)); // hack for single light def
+ dp_strlcpy (com_token, "light_lev", sizeof(com_token)); // hack for single light def
- strlcpy (keyname, com_token, sizeof(keyname));
+ dp_strlcpy (keyname, com_token, sizeof(keyname));
// another hack to fix keynames with trailing spaces
n = strlen(keyname);
if (anglehack)
{
char temp[32];
- strlcpy (temp, com_token, sizeof(temp));
+ dp_strlcpy (temp, com_token, sizeof(temp));
dpsnprintf (com_token, sizeof(com_token), "0 %s 0", temp);
}
break;
if((size_t)(q - p) >= (size_t) sizeof(inbuf))
break;
- strlcpy(inbuf, p, q - p); // not - 1, because this adds a NUL
+ dp_strlcpy(inbuf, p, q - p); // not - 1, because this adds a NUL
PRVM_PO_ParseString(decodedbuf + decodedpos, inbuf, sizeof(decodedbuf) - decodedpos);
decodedpos += strlen(decodedbuf + decodedpos);
if(*q == '\r')
char filename[512];
FS_StripExtension( progname, filename, sizeof( filename ) );
- strlcat( filename, ".lno", sizeof( filename ) );
+ dp_strlcat( filename, ".lno", sizeof( filename ) );
lno = FS_LoadFile( filename, tempmempool, false, &filesize );
if( !lno ) {
switch(d->type & ~DEF_SAVEGLOBAL)
{
case ev_string:
- strlcat(tempstring, "string ", sizeof(tempstring));
+ dp_strlcat(tempstring, "string ", sizeof(tempstring));
break;
case ev_entity:
- strlcat(tempstring, "entity ", sizeof(tempstring));
+ dp_strlcat(tempstring, "entity ", sizeof(tempstring));
break;
case ev_function:
- strlcat(tempstring, "function ", sizeof(tempstring));
+ dp_strlcat(tempstring, "function ", sizeof(tempstring));
break;
case ev_field:
- strlcat(tempstring, "field ", sizeof(tempstring));
+ dp_strlcat(tempstring, "field ", sizeof(tempstring));
break;
case ev_void:
- strlcat(tempstring, "void ", sizeof(tempstring));
+ dp_strlcat(tempstring, "void ", sizeof(tempstring));
break;
case ev_float:
- strlcat(tempstring, "float ", sizeof(tempstring));
+ dp_strlcat(tempstring, "float ", sizeof(tempstring));
break;
case ev_vector:
- strlcat(tempstring, "vector ", sizeof(tempstring));
+ dp_strlcat(tempstring, "vector ", sizeof(tempstring));
break;
case ev_pointer:
- strlcat(tempstring, "pointer ", sizeof(tempstring));
+ dp_strlcat(tempstring, "pointer ", sizeof(tempstring));
break;
default:
dpsnprintf (tempstring2, sizeof(tempstring2), "bad type %i ", d->type & ~DEF_SAVEGLOBAL);
- strlcat(tempstring, tempstring2, sizeof(tempstring));
+ dp_strlcat(tempstring, tempstring2, sizeof(tempstring));
break;
}
if (strlen(name) > sizeof(tempstring2)-4)
tempstring2[sizeof(tempstring2)-1] = 0;
name = tempstring2;
}
- strlcat(tempstring, name, sizeof(tempstring));
+ dp_strlcat(tempstring, name, sizeof(tempstring));
for (j = (int)strlen(name);j < 25;j++)
- strlcat(tempstring, " ", sizeof(tempstring));
+ dp_strlcat(tempstring, " ", sizeof(tempstring));
dpsnprintf(tempstring2, sizeof(tempstring2), "%5d", counts[i]);
- strlcat(tempstring, tempstring2, sizeof(tempstring));
- strlcat(tempstring, "\n", sizeof(tempstring));
+ dp_strlcat(tempstring, tempstring2, sizeof(tempstring));
+ dp_strlcat(tempstring, "\n", sizeof(tempstring));
if (strlen(tempstring) >= sizeof(tempstring)/2)
{
Con_Print(tempstring);
{
debug_data_t *debug = &debug_data[prog - prvm_prog_list];
- strlcpy(debug->break_statement, Cmd_Argv(cmd, 2), sizeof(debug->break_statement));
+ dp_strlcpy(debug->break_statement, Cmd_Argv(cmd, 2), sizeof(debug->break_statement));
}
PRVM_UpdateBreakpoints(prog);
}
{
debug_data_t *debug = &debug_data[prog - prvm_prog_list];
- strlcpy(debug->watch_global, Cmd_Argv(cmd, 2), sizeof(debug->watch_global));
+ dp_strlcpy(debug->watch_global, Cmd_Argv(cmd, 2), sizeof(debug->watch_global));
}
PRVM_UpdateBreakpoints(prog);
}
{
debug_data_t *debug = &debug_data[prog - prvm_prog_list];
debug->watch_edict = atoi(Cmd_Argv(cmd, 2));
- strlcpy(debug->watch_field, Cmd_Argv(cmd, 3), sizeof(debug->watch_field));
+ dp_strlcpy(debug->watch_field, Cmd_Argv(cmd, 3), sizeof(debug->watch_field));
}
PRVM_UpdateBreakpoints(prog);
}
}
else
{
- strlcpy(buf, "<NO PROG>", bufsize);
+ dp_strlcpy(buf, "<NO PROG>", bufsize);
return;
}
{
f = prog->stack[i].f;
- if(strlcat(buf,
+ if(dp_strlcat(buf,
f
? va(vabuf, sizeof(vabuf), "%s:%s(%i) ", PRVM_GetString(prog, f->s_file), PRVM_GetString(prog, f->s_name), prog->stack[i].s - f->first_statement)
: "<NULL> ",
VectorCopy(color, rtlight->color);
rtlight->cubemapname[0] = 0;
if (cubemapname && cubemapname[0])
- strlcpy(rtlight->cubemapname, cubemapname, sizeof(rtlight->cubemapname));
+ dp_strlcpy(rtlight->cubemapname, cubemapname, sizeof(rtlight->cubemapname));
rtlight->shadow = shadow;
rtlight->corona = corona;
rtlight->style = style;
light->style = style;
light->shadow = shadowenable;
light->corona = corona;
- strlcpy(light->cubemapname, cubemapname, sizeof(light->cubemapname));
+ dp_strlcpy(light->cubemapname, cubemapname, sizeof(light->cubemapname));
light->coronasizescale = coronasizescale;
light->ambientscale = ambientscale;
light->diffusescale = diffusescale;
if (com_token[0] == '}')
break; // end of entity
if (com_token[0] == '_')
- strlcpy(key, com_token + 1, sizeof(key));
+ dp_strlcpy(key, com_token + 1, sizeof(key));
else
- strlcpy(key, com_token, sizeof(key));
+ dp_strlcpy(key, com_token, sizeof(key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
if (!COM_ParseToken_Simple(&data, false, false, true))
break; // error
- strlcpy(value, com_token, sizeof(value));
+ dp_strlcpy(value, com_token, sizeof(value));
// now that we have the key pair worked out...
if (!strcmp("light", key))
{
if (!cl.worldmodel)
return;
- strlcpy(r_shadow_mapname, cl.worldname, sizeof(r_shadow_mapname));
+ dp_strlcpy(r_shadow_mapname, cl.worldname, sizeof(r_shadow_mapname));
R_Shadow_ClearWorldLights();
if (r_shadow_realtime_world_importlightentitiesfrommap.integer <= 1)
{
radius = r_shadow_selectedlight->radius;
style = r_shadow_selectedlight->style;
if (*r_shadow_selectedlight->cubemapname)
- strlcpy(cubemapname, r_shadow_selectedlight->cubemapname, sizeof(cubemapname));
+ dp_strlcpy(cubemapname, r_shadow_selectedlight->cubemapname, sizeof(cubemapname));
else
cubemapname[0] = 0;
shadows = r_shadow_selectedlight->shadow;
return;
}
if (Cmd_Argc(cmd) == 3)
- strlcpy(cubemapname, Cmd_Argv(cmd, 2), sizeof(cubemapname));
+ dp_strlcpy(cubemapname, Cmd_Argv(cmd, 2), sizeof(cubemapname));
else
cubemapname[0] = 0;
}
r_shadow_bufferlight.radius = r_shadow_selectedlight->radius;
r_shadow_bufferlight.style = r_shadow_selectedlight->style;
if (*r_shadow_selectedlight->cubemapname)
- strlcpy(r_shadow_bufferlight.cubemapname, r_shadow_selectedlight->cubemapname, sizeof(r_shadow_bufferlight.cubemapname));
+ dp_strlcpy(r_shadow_bufferlight.cubemapname, r_shadow_selectedlight->cubemapname, sizeof(r_shadow_bufferlight.cubemapname));
else
r_shadow_bufferlight.cubemapname[0] = 0;
r_shadow_bufferlight.shadow = r_shadow_selectedlight->shadow;
return false;
}
- strlcpy(skyname, sky, sizeof(skyname));
+ dp_strlcpy(skyname, sky, sizeof(skyname));
return R_LoadSkyBox();
}
if (speedstringcount + length > (vid_conwidth.integer / 8))
{
- strlcat(r_speeds_timestring, "\n", sizeof(r_speeds_timestring));
+ dp_strlcat(r_speeds_timestring, "\n", sizeof(r_speeds_timestring));
speedstringcount = 0;
}
- strlcat(r_speeds_timestring, tempbuf, sizeof(r_speeds_timestring));
+ dp_strlcat(r_speeds_timestring, tempbuf, sizeof(r_speeds_timestring));
speedstringcount += length;
}
teamname = "Total Team Score";
break;
}
- strlcpy(teams[teamlines-1].name, teamname, sizeof(teams[teamlines-1].name));
+ dp_strlcpy(teams[teamlines-1].name, teamname, sizeof(teams[teamlines-1].name));
teams[teamlines-1].frags = 0;
teams[teamlines-1].colors = color + 16 * color;
}
if (cl_showtime.integer)
{
- strlcpy(timestring, Sys_TimeString(cl_showtime_format.string), sizeof(timestring));
+ dp_strlcpy(timestring, Sys_TimeString(cl_showtime_format.string), sizeof(timestring));
fps_strings++;
}
if (cl_showdate.integer)
{
- strlcpy(datestring, Sys_TimeString(cl_showdate_format.string), sizeof(datestring));
+ dp_strlcpy(datestring, Sys_TimeString(cl_showdate_format.string), sizeof(datestring));
fps_strings++;
}
if (cl_showblur.integer)
svtrace = SV_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value);
cltrace = CL_TraceLine(org, dest, MOVE_HITMODEL, NULL, SUPERCONTENTS_SOLID, 0, MATERIALFLAGMASK_TRANSLUCENT, collision_extendmovelength.value, true, false, &hitnetentity, true, true);
if (cltrace.hittexture)
- strlcpy(texstring, cltrace.hittexture->name, sizeof(texstring));
+ dp_strlcpy(texstring, cltrace.hittexture->name, sizeof(texstring));
else
- strlcpy(texstring, "(no texture hit)", sizeof(texstring));
+ dp_strlcpy(texstring, "(no texture hit)", sizeof(texstring));
fps_strings++;
if (svtrace.fraction < cltrace.fraction)
{
dpsnprintf(entstring, sizeof(entstring), "server entity %i", (int)PRVM_EDICT_TO_PROG(svtrace.ent));
}
else
- strlcpy(entstring, "(no entity hit)", sizeof(entstring));
+ dp_strlcpy(entstring, "(no entity hit)", sizeof(entstring));
}
else
{
else if (hitnetentity > 0)
dpsnprintf(entstring, sizeof(entstring), "network entity %i", hitnetentity);
else if (hitnetentity == 0)
- strlcpy(entstring, "world entity", sizeof(entstring));
+ dp_strlcpy(entstring, "world entity", sizeof(entstring));
else
- strlcpy(entstring, "(no entity hit)", sizeof(entstring));
+ dp_strlcpy(entstring, "(no entity hit)", sizeof(entstring));
}
fps_strings++;
}
while (i < Cmd_Argc (cmd))
{
// Get the name, and appends ".wav" as an extension if there's none
- strlcpy (name, Cmd_Argv(cmd, i), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(cmd, i), sizeof (name));
if (!strrchr (name, '.'))
- strlcat (name, ".wav", sizeof (name));
+ dp_strlcat (name, ".wav", sizeof (name));
i++;
// If we need to get the volume from the command line
// Add a sfx_t struct for this sound
sfx = (sfx_t *)Mem_Alloc (snd_mempool, sizeof (*sfx));
memset (sfx, 0, sizeof(*sfx));
- strlcpy (sfx->name, name, sizeof (sfx->name));
+ dp_strlcpy (sfx->name, name, sizeof (sfx->name));
sfx->memsize = sizeof(*sfx);
sfx->next = known_sfx;
known_sfx = sfx;
host.hook.ToggleMenu();
svs.serverflags = 0; // haven't completed an episode yet
- strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
+ dp_strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
SV_SpawnServer(level);
if(sv.active && host.hook.ConnectLocal != NULL)
host.hook.ToggleMenu();
SV_SaveSpawnparms ();
- strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
+ dp_strlcpy(level, Cmd_Argv(cmd, 1), sizeof(level));
SV_SpawnServer(level);
if(sv.active && host.hook.ConnectLocal != NULL)
if(host.hook.ToggleMenu)
host.hook.ToggleMenu();
- strlcpy(mapname, sv.name, sizeof(mapname));
+ dp_strlcpy(mapname, sv.name, sizeof(mapname));
SV_SpawnServer(mapname);
if(sv.active && host.hook.ConnectLocal != NULL)
p2[-1] = 0;
p2--;
}
- strlcat(text, "\n", sizeof(text));
+ dp_strlcat(text, "\n", sizeof(text));
// note: save is not a valid edict if fromServer is true
save = host_client;
}
if(sv_status_privacy.integer && cmd->source != src_local && LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
- strlcpy(ip, client->netconnection ? "hidden" : "botclient", 48);
+ dp_strlcpy(ip, client->netconnection ? "hidden" : "botclient", 48);
else
- strlcpy(ip, (client->netconnection && *client->netconnection->address) ? client->netconnection->address : "botclient", 48);
+ dp_strlcpy(ip, (client->netconnection && *client->netconnection->address) ? client->netconnection->address : "botclient", 48);
frags = client->frags;
{
if (host_client->begun)
SV_BroadcastPrintf("\003%s ^7changed name to ^3%s\n", host_client->old_name, host_client->name);
- strlcpy(host_client->old_name, host_client->name, sizeof(host_client->old_name));
+ dp_strlcpy(host_client->old_name, host_client->name, sizeof(host_client->old_name));
// send notification to all clients
MSG_WriteByte (&sv.reliable_datagram, svc_updatename);
MSG_WriteByte (&sv.reliable_datagram, clientnum);
else
newNameSource = Cmd_Args(cmd);
- strlcpy(newName, newNameSource, sizeof(newName));
+ dp_strlcpy(newName, newNameSource, sizeof(newName));
if (cmd->source == src_local)
return;
host_client->nametime = host.realtime + max(0.0f, sv_namechangetimer.value);
// point the string back at updateclient->name to keep it safe
- strlcpy (host_client->name, newName, sizeof (host_client->name));
+ dp_strlcpy (host_client->name, newName, sizeof (host_client->name));
for (i = 0, j = 0;host_client->name[i];i++)
if (host_client->name[i] != '\r' && host_client->name[i] != '\n')
return;
if (Cmd_Argc (cmd) == 2)
- strlcpy (newPath, Cmd_Argv(cmd, 1), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Argv(cmd, 1), sizeof (newPath));
else
- strlcpy (newPath, Cmd_Args(cmd), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Args(cmd), sizeof (newPath));
for (i = 0, j = 0;newPath[i];i++)
if (newPath[i] != '\r' && newPath[i] != '\n')
*/
// point the string back at updateclient->name to keep it safe
- strlcpy (host_client->playermodel, newPath, sizeof (host_client->playermodel));
+ dp_strlcpy (host_client->playermodel, newPath, sizeof (host_client->playermodel));
PRVM_serveredictstring(host_client->edict, playermodel) = PRVM_SetEngineString(prog, host_client->playermodel);
if (strcmp(host_client->old_model, host_client->playermodel))
{
- strlcpy(host_client->old_model, host_client->playermodel, sizeof(host_client->old_model));
+ dp_strlcpy(host_client->old_model, host_client->playermodel, sizeof(host_client->old_model));
/*// send notification to all clients
MSG_WriteByte (&sv.reliable_datagram, svc_updatepmodel);
MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
return;
if (Cmd_Argc (cmd) == 2)
- strlcpy (newPath, Cmd_Argv(cmd, 1), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Argv(cmd, 1), sizeof (newPath));
else
- strlcpy (newPath, Cmd_Args(cmd), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Args(cmd), sizeof (newPath));
for (i = 0, j = 0;newPath[i];i++)
if (newPath[i] != '\r' && newPath[i] != '\n')
*/
// point the string back at updateclient->name to keep it safe
- strlcpy (host_client->playerskin, newPath, sizeof (host_client->playerskin));
+ dp_strlcpy (host_client->playerskin, newPath, sizeof (host_client->playerskin));
PRVM_serveredictstring(host_client->edict, playerskin) = PRVM_SetEngineString(prog, host_client->playerskin);
if (strcmp(host_client->old_skin, host_client->playerskin))
{
//if (host_client->begun)
// SV_BroadcastPrintf("%s changed skin to %s\n", host_client->name, host_client->playerskin);
- strlcpy(host_client->old_skin, host_client->playerskin, sizeof(host_client->old_skin));
+ dp_strlcpy(host_client->old_skin, host_client->playerskin, sizeof(host_client->old_skin));
/*// send notification to all clients
MSG_WriteByte (&sv.reliable_datagram, svc_updatepskin);
MSG_WriteByte (&sv.reliable_datagram, host_client - svs.clients);
if(client->sv_demo_file != NULL)
return; // we already have a demo
- strlcpy(name, filename, sizeof(name));
+ dp_strlcpy(name, filename, sizeof(name));
FS_DefaultExtension(name, ".dem", sizeof(name));
Con_Printf("Recording demo for # %d (%s) to %s\n", PRVM_NUM_FOR_EDICT(client->edict), client->netaddress, name);
);
}
- strlcpy(client->name, "unconnected", sizeof(client->name));
- strlcpy(client->old_name, "unconnected", sizeof(client->old_name));
+ dp_strlcpy(client->name, "unconnected", sizeof(client->name));
+ dp_strlcpy(client->old_name, "unconnected", sizeof(client->old_name));
client->prespawned = false;
client->spawned = false;
client->begun = false;
Download_CheckExtensions(cmd);
- strlcpy(host_client->download_name, Cmd_Argv(cmd, 1), sizeof(host_client->download_name));
+ dp_strlcpy(host_client->download_name, Cmd_Argv(cmd, 1), sizeof(host_client->download_name));
extension = FS_FileExtension(host_client->download_name);
// host_client is asking to download a specified file
extensions[0] = '\0';
if(host_client->download_deflate)
- strlcat(extensions, " deflate", sizeof(extensions));
+ dp_strlcat(extensions, " deflate", sizeof(extensions));
Con_DPrintf("Downloading %s to %s\n", host_client->download_name, host_client->name);
// testing
//if (precachemode == 2)
// return 0;
- strlcpy(filename, s, sizeof(filename));
+ dp_strlcpy(filename, s, sizeof(filename));
for (i = 2;i < limit;i++)
{
if (!sv.model_precache[i][0])
}
if (precachemode == 1)
Con_Printf("SV_ModelIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
- strlcpy(sv.model_precache[i], filename, sizeof(sv.model_precache[i]));
+ dp_strlcpy(sv.model_precache[i], filename, sizeof(sv.model_precache[i]));
if (sv.state == ss_loading)
{
// running from SV_SpawnServer which is launched from the client console command interpreter
// testing
//if (precachemode == 2)
// return 0;
- strlcpy(filename, s, sizeof(filename));
+ dp_strlcpy(filename, s, sizeof(filename));
for (i = 1;i < limit;i++)
{
if (!sv.sound_precache[i][0])
}
if (precachemode == 1)
Con_Printf("SV_SoundIndex(\"%s\"): not precached (fix your code), precaching anyway\n", filename);
- strlcpy(sv.sound_precache[i], filename, sizeof(sv.sound_precache[i]));
+ dp_strlcpy(sv.sound_precache[i], filename, sizeof(sv.sound_precache[i]));
if (sv.state != ss_loading)
{
MSG_WriteByte(&sv.reliable_datagram, svc_precache);
sv.particleeffectnamesloaded = true;
memset(sv.particleeffectname, 0, sizeof(sv.particleeffectname));
for (i = 0;i < EFFECT_TOTAL;i++)
- strlcpy(sv.particleeffectname[i], standardeffectnames[i], sizeof(sv.particleeffectname[i]));
+ dp_strlcpy(sv.particleeffectname[i], standardeffectnames[i], sizeof(sv.particleeffectname[i]));
for (filepass = 0;;filepass++)
{
if (filepass == 0)
break;
if (argc < 16)
{
- strlcpy(argv[argc], com_token, sizeof(argv[argc]));
+ dp_strlcpy(argv[argc], com_token, sizeof(argv[argc]));
argc++;
}
}
}
else
{
- strlcpy(sv.particleeffectname[effectnameindex], argv[1], sizeof(sv.particleeffectname[effectnameindex]));
+ dp_strlcpy(sv.particleeffectname[effectnameindex], argv[1], sizeof(sv.particleeffectname[effectnameindex]));
break;
}
}
sv.csqc_progsize = (int)progsize;
sv.csqc_progcrc = CRC_Block(svs.csqc_progdata, progsize);
- strlcpy(sv.csqc_progname, csqc_progname.string, sizeof(sv.csqc_progname));
+ dp_strlcpy(sv.csqc_progname, csqc_progname.string, sizeof(sv.csqc_progname));
Con_DPrintf("server detected csqc progs file \"%s\" with size %i and crc %i\n", sv.csqc_progname, sv.csqc_progsize, sv.csqc_progcrc);
Con_DPrint("Compressing csprogs.dat\n");
sv.active = true;
// set level base name variables for later use
- strlcpy (sv.name, map, sizeof (sv.name));
- strlcpy(sv.worldname, modelname, sizeof(sv.worldname));
+ dp_strlcpy (sv.name, map, sizeof (sv.name));
+ dp_strlcpy(sv.worldname, modelname, sizeof(sv.worldname));
FS_StripExtension(sv.worldname, sv.worldnamenoextension, sizeof(sv.worldnamenoextension));
- strlcpy(sv.worldbasename, !strncmp(sv.worldnamenoextension, "maps/", 5) ? sv.worldnamenoextension + 5 : sv.worldnamenoextension, sizeof(sv.worldbasename));
+ dp_strlcpy(sv.worldbasename, !strncmp(sv.worldnamenoextension, "maps/", 5) ? sv.worldnamenoextension + 5 : sv.worldnamenoextension, sizeof(sv.worldbasename));
//Cvar_SetQuick(&sv_worldmessage, sv.worldmessage); // set later after QC is spawned
Cvar_SetQuick(&sv_worldname, sv.worldname);
Cvar_SetQuick(&sv_worldnamenoextension, sv.worldnamenoextension);
World_SetSize(&sv.world, sv.worldname, sv.worldmodel->normalmins, sv.worldmodel->normalmaxs, prog);
World_Start(&sv.world);
- strlcpy(sv.sound_precache[0], "", sizeof(sv.sound_precache[0]));
+ dp_strlcpy(sv.sound_precache[0], "", sizeof(sv.sound_precache[0]));
- strlcpy(sv.model_precache[0], "", sizeof(sv.model_precache[0]));
- strlcpy(sv.model_precache[1], sv.worldname, sizeof(sv.model_precache[1]));
+ dp_strlcpy(sv.model_precache[0], "", sizeof(sv.model_precache[0]));
+ dp_strlcpy(sv.model_precache[1], sv.worldname, sizeof(sv.model_precache[1]));
for (i = 1;i < sv.worldmodel->brush.numsubmodels && i+1 < MAX_MODELS;i++)
{
dpsnprintf(sv.model_precache[i+1], sizeof(sv.model_precache[i+1]), "*%i", i);
}
// update the map title cvar
- strlcpy(sv.worldmessage, PRVM_GetString(prog, PRVM_serveredictstring(prog->edicts, message)), sizeof(sv.worldmessage)); // map title (not related to filename)
+ dp_strlcpy(sv.worldmessage, PRVM_GetString(prog, PRVM_serveredictstring(prog->edicts, message)), sizeof(sv.worldmessage)); // map title (not related to filename)
Cvar_SetQuick(&sv_worldmessage, sv.worldmessage);
Con_Printf("Server spawned.\n");
return;
}
- strlcpy (name, Cmd_Argv(cmd, 1), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(cmd, 1), sizeof (name));
FS_DefaultExtension (name, ".sav", sizeof (name));
SV_Savegame_to(prog, name);
return;
}
- strlcpy (filename, Cmd_Argv(cmd, 1), sizeof(filename));
+ dp_strlcpy (filename, Cmd_Argv(cmd, 1), sizeof(filename));
FS_DefaultExtension (filename, ".sav", sizeof (filename));
Con_Printf("Loading game from %s...\n", filename);
// mapname
COM_ParseToken_Simple(&t, false, false, true);
- strlcpy (mapname, com_token, sizeof(mapname));
+ dp_strlcpy (mapname, com_token, sizeof(mapname));
if(developer_entityparsing.integer)
Con_Printf("SV_Loadgame_f: loading time\n");
t = start;
break;
}
- strlcpy(sv.lightstyles[i], com_token, sizeof(sv.lightstyles[i]));
+ dp_strlcpy(sv.lightstyles[i], com_token, sizeof(sv.lightstyles[i]));
}
if(developer_entityparsing.integer)
i = atoi(com_token);
COM_ParseToken_Simple(&t, false, false, true);
if (i >= 0 && i < MAX_LIGHTSTYLES)
- strlcpy(sv.lightstyles[i], com_token, sizeof(sv.lightstyles[i]));
+ dp_strlcpy(sv.lightstyles[i], com_token, sizeof(sv.lightstyles[i]));
else
Con_Printf("unsupported lightstyle %i \"%s\"\n", i, com_token);
}
COM_ParseToken_Simple(&t, false, false, true);
if (i >= 0 && i < MAX_MODELS)
{
- strlcpy(sv.model_precache[i], com_token, sizeof(sv.model_precache[i]));
+ dp_strlcpy(sv.model_precache[i], com_token, sizeof(sv.model_precache[i]));
sv.models[i] = Mod_ForName (sv.model_precache[i], true, false, sv.model_precache[i][0] == '*' ? sv.worldname : NULL);
}
else
i = atoi(com_token);
COM_ParseToken_Simple(&t, false, false, true);
if (i >= 0 && i < MAX_SOUNDS)
- strlcpy(sv.sound_precache[i], com_token, sizeof(sv.sound_precache[i]));
+ dp_strlcpy(sv.sound_precache[i], com_token, sizeof(sv.sound_precache[i]));
else
Con_Printf("unsupported sound %i \"%s\"\n", i, com_token);
}
s = PRVM_GetString(prog, PRVM_serveredictstring(ent, weaponmodel));
if (strcmp(s, client->weaponmodel))
{
- strlcpy(client->weaponmodel, s, sizeof(client->weaponmodel));
+ dp_strlcpy(client->weaponmodel, s, sizeof(client->weaponmodel));
client->weaponmodelindex = SV_ModelIndex(s, 1);
}
// always point the string back at host_client->name to keep it safe
//strlcpy (host_client->name, name, sizeof (host_client->name));
if (name != host_client->name) // prevent buffer overlap SIGABRT on Mac OSX
- strlcpy (host_client->name, name, sizeof (host_client->name));
+ dp_strlcpy (host_client->name, name, sizeof (host_client->name));
SV_Name(i);
// DP_SV_CLIENTCOLORS
// always point the string back at host_client->name to keep it safe
//strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
if (model != host_client->playermodel) // prevent buffer overlap SIGABRT on Mac OSX
- strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
+ dp_strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
PRVM_serveredictstring(host_client->edict, playermodel) = PRVM_SetEngineString(prog, host_client->playermodel);
// NEXUIZ_PLAYERSKIN
// always point the string back at host_client->name to keep it safe
//strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
if (skin != host_client->playerskin) // prevent buffer overlap SIGABRT on Mac OSX
- strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
+ dp_strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
PRVM_serveredictstring(host_client->edict, playerskin) = PRVM_SetEngineString(prog, host_client->playerskin);
// TODO: add an extension name for this [1/17/2008 Black]
}
// change the string in sv
- strlcpy(sv.lightstyles[style], val, sizeof(sv.lightstyles[style]));
+ dp_strlcpy(sv.lightstyles[style], val, sizeof(sv.lightstyles[style]));
// send message to all clients on this server
if (sv.state != ss_active)
//string as 16 bytes
case 1:
memset(s, 0, 17);
- strlcpy(s, PRVM_E_STRING(ent, vm_customstats[i].fieldoffset), 16);
+ dp_strlcpy(s, PRVM_E_STRING(ent, vm_customstats[i].fieldoffset), 16);
stats[i] = s[ 0] + s[ 1] * 256 + s[ 2] * 65536 + s[ 3] * 16777216;
stats[i+1] = s[ 4] + s[ 5] * 256 + s[ 6] * 65536 + s[ 7] * 16777216;
stats[i+2] = s[ 8] + s[ 9] * 256 + s[10] * 65536 + s[11] * 16777216;
size_t allocsize;
allocsize = min(MAX_INPUTLINE, strlen(cliptext) + 1);
data = (char *)Z_Malloc (allocsize);
- strlcpy (data, cliptext, allocsize);
+ dp_strlcpy (data, cliptext, allocsize);
SDL_free(cliptext);
}
if (!dllhandle && strrchr(sys.argv[0], '/'))
{
char path[MAX_OSPATH];
- strlcpy(path, sys.argv[0], sizeof(path));
+ dp_strlcpy(path, sys.argv[0], sizeof(path));
strrchr(path, '/')[1] = 0;
for (i = 0; dllnames[i] != NULL; i++)
{
char temp[MAX_OSPATH];
- strlcpy(temp, path, sizeof(temp));
- strlcat(temp, dllnames[i], sizeof(temp));
+ dp_strlcpy(temp, path, sizeof(temp));
+ dp_strlcat(temp, dllnames[i], sizeof(temp));
Con_DPrintf (" \"%s\"", temp);
if(Sys_LoadLibrary(temp, &dllhandle))
{
Con_DPrintf("GL context is missing required function \"%s\"!\n", func->name);
missingrequiredfuncs = true;
- strlcat(missingfuncs, " ", sizeof(missingfuncs));
- strlcat(missingfuncs, func->name, sizeof(missingfuncs));
+ dp_strlcat(missingfuncs, " ", sizeof(missingfuncs));
+ dp_strlcat(missingfuncs, func->name, sizeof(missingfuncs));
}
}
{
int i;
- strlcpy(world->filename, filename, sizeof(world->filename));
+ dp_strlcpy(world->filename, filename, sizeof(world->filename));
VectorCopy(mins, world->mins);
VectorCopy(maxs, world->maxs);
world->prog = prog;
List_Create(&pool->chain);
pool->totalsize = 0;
pool->realsize = sizeof(mempool_t);
- strlcpy (pool->name, name, sizeof (pool->name));
+ dp_strlcpy (pool->name, name, sizeof (pool->name));
pool->parent = parent;
pool->next = poolchain;
poolchain = pool;
return NULL;
sz = strlen (s) + 1;
p = (char*)_Mem_Alloc (pool, NULL, sz, 16, filename, fileline);
- strlcpy (p, s, sz);
+ dp_strlcpy (p, s, sz);
return p;
}