// COMMANDLINEOPTION: BSD Sound: -cddev <devicepath> chooses which CD drive to use
if ((i = COM_CheckParm("-cddev")) != 0 && i < com_argc - 1)
- strlcpy(cd_dev, com_argv[i + 1], sizeof(cd_dev));
+ dp_strlcpy(cd_dev, com_argv[i + 1], sizeof(cd_dev));
}
int CDAudio_SysStartup (void)
// COMMANDLINEOPTION: Linux Sound: -cddev <devicepath> chooses which CD drive to use
if ((i = COM_CheckParm("-cddev")) != 0 && i < com_argc - 1)
- strlcpy(cd_dev, com_argv[i + 1], sizeof(cd_dev));
+ dp_strlcpy(cd_dev, com_argv[i + 1], sizeof(cd_dev));
}
int CDAudio_SysStartup (void)
return;
}
for (n = 1; n <= ret; n++)
- strlcpy(remap[n], Cmd_Argv (n+1), sizeof(*remap));
+ dp_strlcpy(remap[n], Cmd_Argv (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;
}
}
track = -1;
// get the demo name
- strlcpy (name, Cmd_Argv(1), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(1), sizeof (name));
FS_DefaultExtension (name, ".dem", sizeof (name));
// start the map up
Con_Print("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);
}
// open the demo file
- strlcpy (name, Cmd_Argv(1), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(1), 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;
return NULL;
}
dyntexture = &dyntextures[ dyntexturecount++ ];
- strlcpy( dyntexture->name, name, sizeof( dyntexture->name ) );
+ dp_strlcpy( dyntexture->name, name, sizeof( dyntexture->name ) );
dyntexture->texture = DEFAULT_DYNTEXTURE;
return dyntexture;
}
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;
r_refdef.fog_end = atof(Cmd_Argv(7));
r_refdef.fog_height = atof(Cmd_Argv(8));
r_refdef.fog_fadedepth = atof(Cmd_Argv(9));
- strlcpy(r_refdef.fog_height_texturename, Cmd_Argv(10), sizeof(r_refdef.fog_height_texturename));
+ dp_strlcpy(r_refdef.fog_height_texturename, Cmd_Argv(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(2), sizeof(cls.qw_downloadname));
+ dp_strlcpy(cls.qw_downloadname, Cmd_Argv(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], temp[64];
int count;
- strlcpy(description, "packet dump: ", sizeof(description));
+ dp_strlcpy(description, "packet dump: ", sizeof(description));
i = cmdcount - 32;
if (i < 0)
i = 0;
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], temp[64];
int count;
- strlcpy (description, "packet dump: ", sizeof(description));
+ dp_strlcpy (description, "packet dump: ", sizeof(description));
i = cmdcount - 32;
if (i < 0)
i = 0;
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;
if(Cmd_Argc() == 3)
{
scr_infobartime_off = atof(Cmd_Argv(1));
- strlcpy(scr_infobarstring, Cmd_Argv(2), sizeof(scr_infobarstring));
+ dp_strlcpy(scr_infobarstring, Cmd_Argv(2), sizeof(scr_infobarstring));
}
else
{
if (Cmd_Argc() == 2)
{
const char *ext;
- strlcpy(filename, Cmd_Argv(1), sizeof(filename));
+ dp_strlcpy(filename, Cmd_Argv(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(1), sizeof (basename));
+ dp_strlcpy (basename, Cmd_Argv(1), sizeof (basename));
size = atoi(Cmd_Argv(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) // LordHavoc: 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);
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) );
video->ownertag = owner;
if( strncmp( name, CLVIDEOPREFIX, sizeof( CLVIDEOPREFIX ) - 1 ) )
return NULL;
- strlcpy( video->cpif.name, name, sizeof(video->cpif.name) );
+ dp_strlcpy( video->cpif.name, name, sizeof(video->cpif.name) );
if( !OpenStream( video ) )
return NULL;
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);
}
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);
c = Cmd_Argc();
if(c >= 2)
{
- strlcpy(msg, Cmd_Argv(1), sizeof(msg));
+ dp_strlcpy(msg, Cmd_Argv(1), sizeof(msg));
for(i = 2; i < c; ++i)
{
strlcat(msg, " ", sizeof(msg));
cmdalias_t *prev, *current;
a = (cmdalias_t *)Z_Malloc (sizeof(cmdalias_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_alias ; current && strcmp( current->name, a->name ) < 0 ; prev = current, current = current->next )
;
// 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);
}
}
}
//========================================================
-// strlcat and strlcpy, from OpenBSD
+// strlcat and dp_strlcpy, from OpenBSD
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
#endif // #ifndef HAVE_STRLCAT
-#ifndef HAVE_STRLCPY
+//#ifndef HAVE_STRLCPY
size_t
-strlcpy(char *dst, const char *src, size_t siz)
+dp_strlcpy(char *dst, const char *src, size_t siz)
{
register char *d = dst;
register const char *s = src;
return(s - src - 1); /* count does not include NUL */
}
-#endif // #ifndef HAVE_STRLCPY
+//#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, "}"))
size_t strlcat(char *dst, const char *src, size_t siz);
#endif // #ifndef HAVE_STRLCAT
-#ifndef HAVE_STRLCPY
+//#ifndef HAVE_STRLCPY
/*!
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
-size_t strlcpy(char *dst, const char *src, size_t siz);
+size_t dp_strlcpy(char *dst, const char *src, size_t siz);
-#endif // #ifndef HAVE_STRLCPY
+//#endif // #ifndef HAVE_STRLCPY
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"));
}
}
if (!key_consoleactive)
return; // don't draw anything
- strlcpy(editlinecopy, key_line, sizeof(editlinecopy));
+ dp_strlcpy(editlinecopy, key_line, sizeof(editlinecopy));
text = editlinecopy;
// Advanced Console Editing by Radix radix@planetquake.com
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))
{
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 = key_line + pos;
- strlcpy(s2, key_line + key_linepos, sizeof(s2)); //save chars after cursor
+ dp_strlcpy(s2, key_line + key_linepos, sizeof(s2)); //save chars after cursor
key_line[key_linepos] = 0; //hide them
space = strchr(key_line + 1, ' ');
if(space && pos == (space - key_line) + 1)
{
- strlcpy(command, key_line + 1, min(sizeof(command), (unsigned int)(space - key_line)));
+ dp_strlcpy(command, key_line + 1, min(sizeof(command), (unsigned int)(space - key_line)));
patterns = Cvar_VariableString(va(vabuf, sizeof(vabuf), "con_completion_%s", command)); // TODO maybe use a better place for this?
if(patterns && !*patterns)
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
+ dp_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));
search = FS_Search(t, true, true);
}
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
+ dp_strlcpy(t, s, min(sizeof(t), (unsigned int)(slash - s + 2))); // + 2, because I want to include the slash
strlcat(t, "*", sizeof(t));
search = FS_Search(t, true, true);
}
// 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
if (!(c + v + a + n)) // No possible matches
{
if(s2[0])
- strlcpy(&key_line[key_linepos], s2, sizeof(key_line) - key_linepos);
+ dp_strlcpy(&key_line[key_linepos], s2, sizeof(key_line) - key_linepos);
return;
}
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;
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;
l = strlen(p);
if(l > sizeof(buf) - 1)
l = sizeof(buf) - 1;
- strlcpy(buf, p, l + 1); // strlcpy needs a + 1 as it includes the newline!
+ dp_strlcpy(buf, p, l + 1); // dp_strlcpy needs a + 1 as it includes the newline!
Cmd_ExecuteString(buf, src_command, true);
char pattern[4096], *c;
WIN32_FIND_DATA n_file;
HANDLE hFile;
- strlcpy (pattern, basepath, sizeof(pattern));
+ dp_strlcpy (pattern, basepath, sizeof(pattern));
strlcat (pattern, path, sizeof (pattern));
strlcat (pattern, "*", sizeof (pattern));
// ask for the directory listing handle
// 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 = -1;
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));
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
Cvar_SetQuick (&scr_screenshot_name, gamescreenshotname);
if((i = COM_CheckParm("-modname")) && i < com_argc - 1)
- strlcpy(com_modname, com_argv[i+1], sizeof(com_modname));
+ dp_strlcpy(com_modname, com_argv[i+1], sizeof(com_modname));
// If "-condebug" is in the command line, remove the previous log file
if (COM_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(i+1), sizeof(gamedirs[i]));
+ dp_strlcpy(gamedirs[i], Cmd_Argv(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[com_argc + 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 = COM_CheckParm ("-basedir");
if (i && i < com_argc-1)
{
- strlcpy (fs_basedir, com_argv[i+1], sizeof (fs_basedir));
+ dp_strlcpy (fs_basedir, com_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(com_argv[0], ".app/"))
{
char *split;
- strlcpy(fs_basedir, com_argv[0], sizeof(fs_basedir));
+ dp_strlcpy(fs_basedir, com_argv[0], sizeof(fs_basedir));
split = strstr(fs_basedir, ".app/");
if (split)
{
if(p == fs_checkgamedir_missing)
Con_Printf("WARNING: -game %s%s/ not found!\n", fs_basedir, com_argv[i]);
// add the gamedir to the list of active gamedirs
- strlcpy (fs_gamedirs[fs_numgamedirs], com_argv[i], sizeof(fs_gamedirs[fs_numgamedirs]));
+ dp_strlcpy (fs_gamedirs[fs_numgamedirs], com_argv[i], sizeof(fs_gamedirs[fs_numgamedirs]));
fs_numgamedirs++;
}
}
pak = searchpath->pack;
for (i = 0;i < pak->numfiles;i++)
{
- 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++ ) {
- strlcpy( temp, matchedSet.strings[ dirlistindex ], sizeof(temp) );
+ dp_strlcpy( temp, matchedSet.strings[ dirlistindex ], sizeof(temp) );
strlcat( temp, subpath, sizeof(temp) );
listdirectory( &foundSet, searchpath->filename, temp );
}
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("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;
}
}
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;
}
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(fnt->tex == r_texture_notexture)
{
fnt->tex = Draw_CachePic_Flags("gfx/conchars", CACHEPICFLAG_NOCOMPRESSION | (r_nearest_conchars.integer ? CACHEPICFLAG_NEAREST : 0))->tex;
- 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;
}
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)
}
if (vslog)
{
- strlcpy(temp, (const char *)ID3DXBuffer_GetBufferPointer(vslog), min(sizeof(temp), ID3DXBuffer_GetBufferSize(vslog)));
+ dp_strlcpy(temp, (const char *)ID3DXBuffer_GetBufferPointer(vslog), min(sizeof(temp), ID3DXBuffer_GetBufferSize(vslog)));
Con_DPrintf("HLSL vertex shader compile output for %s follows:\n%s\n", cachename, temp);
ID3DXBuffer_Release(vslog);
}
}
if (pslog)
{
- strlcpy(temp, (const char *)ID3DXBuffer_GetBufferPointer(pslog), min(sizeof(temp), ID3DXBuffer_GetBufferSize(pslog)));
+ dp_strlcpy(temp, (const char *)ID3DXBuffer_GetBufferPointer(pslog), min(sizeof(temp), ID3DXBuffer_GetBufferSize(pslog)));
Con_DPrintf("HLSL pixel shader compile output for %s follows:\n%s\n", cachename, temp);
ID3DXBuffer_Release(pslog);
}
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->base = dyntexture; // either NULL or dyntexture handle
item->textureflags = textureflags & ~TEXF_FORCE_RELOAD;
item->comparewidth = comparewidth;
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(sv_status_privacy.integer && cmd_source != src_command)
- 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;
svs.serverflags = 0; // haven't completed an episode yet
allowcheats = sv_cheats.integer != 0;
- strlcpy(level, Cmd_Argv(1), sizeof(level));
+ dp_strlcpy(level, Cmd_Argv(1), sizeof(level));
SV_SpawnServer(level);
if (sv.active && cls.state == ca_disconnected)
CL_EstablishConnection("local:1", -2);
SV_SaveSpawnparms ();
allowcheats = sv_cheats.integer != 0;
- strlcpy(level, Cmd_Argv(1), sizeof(level));
+ dp_strlcpy(level, Cmd_Argv(1), sizeof(level));
SV_SpawnServer(level);
if (sv.active && cls.state == ca_disconnected)
CL_EstablishConnection("local:1", -2);
key_dest = key_game;
allowcheats = sv_cheats.integer != 0;
- strlcpy(mapname, sv.name, sizeof(mapname));
+ dp_strlcpy(mapname, sv.name, sizeof(mapname));
SV_SpawnServer(mapname);
if (sv.active && cls.state == ca_disconnected)
CL_EstablishConnection("local:1", -2);
return;
}
- strlcpy (name, Cmd_Argv(1), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(1), sizeof (name));
FS_DefaultExtension (name, ".sav", sizeof (name));
Host_Savegame_to(prog, name);
return;
}
- strlcpy (filename, Cmd_Argv(1), sizeof(filename));
+ dp_strlcpy (filename, Cmd_Argv(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("Host_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);
}
else
newNameSource = Cmd_Args();
- strlcpy(newName, newNameSource, sizeof(newName));
+ dp_strlcpy(newName, newNameSource, sizeof(newName));
if (cmd_source == src_command)
{
host_client->nametime = 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')
{
if (host_client->begun)
SV_BroadcastPrintf("%s ^7changed name to %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, host_client - svs.clients);
}
if (Cmd_Argc () == 2)
- strlcpy (newPath, Cmd_Argv(1), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Argv(1), sizeof (newPath));
else
- strlcpy (newPath, Cmd_Args(), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Args(), 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);
}
if (Cmd_Argc () == 2)
- strlcpy (newPath, Cmd_Argv(1), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Argv(1), sizeof (newPath));
else
- strlcpy (newPath, Cmd_Args(), sizeof (newPath));
+ dp_strlcpy (newPath, Cmd_Args(), 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);
Con_DPrintf("%i demo(s) in loop\n", c);
for (i=1 ; i<c+1 ; i++)
- strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof (cls.demos[i-1]));
+ dp_strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof (cls.demos[i-1]));
// LordHavoc: clear the remaining slots
for (;i <= MAX_DEMOS;i++)
Con_Printf ("You must either be connected, or set the rcon_address cvar to issue rcon commands\n");
return;
}
- strlcpy(peer_address, rcon_address.string, strlen(rcon_address.string)+1);
+ dp_strlcpy(peer_address, rcon_address.string, strlen(rcon_address.string)+1);
}
LHNETADDRESS_FromString(&to, peer_address, sv_netport.integer);
mysocket = NetConn_ChooseClientSocketForAddress(&to);
++cls.rcon_trying;
if(i >= MAX_RCONS)
NetConn_WriteString(mysocket, "\377\377\377\377getchallenge", &to); // otherwise we'll request the challenge later
- strlcpy(cls.rcon_commands[cls.rcon_ringpos], Cmd_Args(), sizeof(cls.rcon_commands[cls.rcon_ringpos]));
+ dp_strlcpy(cls.rcon_commands[cls.rcon_ringpos], Cmd_Args(), sizeof(cls.rcon_commands[cls.rcon_ringpos]));
cls.rcon_addresses[cls.rcon_ringpos] = to;
cls.rcon_timeout[cls.rcon_ringpos] = 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), &to);
}
}
return;
}
- strlcpy (cl.qw_serverinfo, Cmd_Argv(1), sizeof(cl.qw_serverinfo));
+ dp_strlcpy (cl.qw_serverinfo, Cmd_Argv(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);
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];
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;
cbd[i]=0;
temp[0]=0;
if ( key_linepos < (int)strlen(key_line) )
- strlcpy(temp, key_line + key_linepos, (int)strlen(key_line) - key_linepos +1);
+ dp_strlcpy(temp, key_line + key_linepos, (int)strlen(key_line) - key_linepos +1);
key_line[key_linepos] = 0;
strlcat(key_line, cbd, sizeof(key_line));
if (temp[0])
if (key_linepos > 1)
{
int newpos = (int)u8_prevbyte(key_line+1, key_linepos-1) + 1; // do NOT give the ']' to u8_prevbyte
- strlcpy(key_line + newpos, key_line + key_linepos, sizeof(key_line) + 1 - key_linepos);
+ dp_strlcpy(key_line + newpos, key_line + key_linepos, sizeof(key_line) + 1 - key_linepos);
key_linepos = newpos;
}
return;
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;
}
void M_Update_Return_Reason(const char *s)
{
- strlcpy(m_return_reason, s, sizeof(m_return_reason));
+ dp_strlcpy(m_return_reason, s, sizeof(m_return_reason));
if (s)
Con_DPrintf("%s\n", s);
}
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_color.integer >> 4;
setup_bottom = setup_oldbottom = cl_color.integer & 15;
setup_rate = cl_rate.integer;
*b = Z_Alloc(sizeof(binditem_t) + strlen(command) + 1 + strlen(description) + 1);
*b->command = (char *)((*b) + 1);
*b->description = *b->command + strlen(command) + 1;
- strlcpy(*b->command, command, strlen(command) + 1);
- strlcpy(*b->description, description, strlen(description) + 1);
+ dp_strlcpy(*b->command, command, strlen(command) + 1);
+ dp_strlcpy(*b->description, description, strlen(description) + 1);
}
static void M_AddBind (char *category, char *command, char *description)
// LordHavoc: 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[2];
if (FS_CheckNastyPath (list.strings[i], true)) continue;
if (!FS_CheckGameDir(list.strings[i])) 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_BuildAliasSkinFromSkinFrame(loadmodel->data_textures + totalskins * loadmodel->num_surfaces, 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++)
// 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;
}
skinframe = NULL;
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;
loadmodel->data_textures[i] = backuptex;
tx = loadmodel->data_textures + i;
- 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 // LordHavoc: bsp version 29 (normal white lighting)
{
// LordHavoc: 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));
+ dp_strlcpy (dlitfilename, litfilename, sizeof (dlitfilename));
strlcat (litfilename, ".lit", sizeof (litfilename));
strlcat (dlitfilename, ".dlit", sizeof (dlitfilename));
data = (unsigned char*) FS_LoadFile(litfilename, tempmempool, false, &filesize);
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))
COM_ParseToken_Simple(&data, false, false, true);
}
COM_ParseToken_Simple(&data, false, false, true);
- strlcpy(facetexture, com_token, sizeof(facetexture));
+ dp_strlcpy(facetexture, com_token, sizeof(facetexture));
COM_ParseToken_Simple(&data, false, false, true);
//scroll_s = atof(com_token);
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(dp_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);
}
dp_model_t *mod = (dp_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 = (dp_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)
{
q3shaderinfo_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;
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(1), sizeof(inname));
+ dp_strlcpy(inname, Cmd_Argv(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);
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
memset(entry, 0, sizeof(*entry));
// store the data the engine cares about (address and ping)
- strlcpy(entry->info.cname, addressstring, sizeof(entry->info.cname));
+ dp_strlcpy(entry->info.cname, addressstring, sizeof(entry->info.cname));
entry->info.ping = 100000;
entry->querytime = realtime;
// if not in the slist menu we should print the server to console
memset(entry, 0, sizeof(*entry));
entry->protocol = protocol;
// store the data the engine cares about (address and ping)
- strlcpy (entry->info.cname, ipstring, sizeof(entry->info.cname));
+ dp_strlcpy (entry->info.cname, ipstring, sizeof(entry->info.cname));
entry->info.isfavorite = isfavorite;
{
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;
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;
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);
if (IS_NEXUIZ_DERIVED(gamemode) && (teamplay.integer > 0))
{
if(cl->frags == -666) // spectator
- strlcpy(teambuf, " 0", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 0", sizeof(teambuf));
else if(cl->colors == 0x44) // red team
- strlcpy(teambuf, " 1", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 1", sizeof(teambuf));
else if(cl->colors == 0xDD) // blue team
- strlcpy(teambuf, " 2", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 2", sizeof(teambuf));
else if(cl->colors == 0xCC) // yellow team
- strlcpy(teambuf, " 3", sizeof(teambuf));
+ dp_strlcpy(teambuf, " 3", sizeof(teambuf));
else if(cl->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])
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])
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);
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);
- 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;
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
{
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 );
}
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;
break;
case ev_function:
f = prog->functions + val->function;
- strlcpy (line, PRVM_GetString (prog, f->s_name), linelength);
+ dp_strlcpy (line, PRVM_GetString (prog, f->s_name), linelength);
break;
case ev_field:
def = PRVM_ED_FieldAtOfs ( prog, val->_int );
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')
{
debug_data_t *debug = &debug_data[prog - prvm_prog_list];
- strlcpy(debug->break_statement, Cmd_Argv(2), sizeof(debug->break_statement));
+ dp_strlcpy(debug->break_statement, Cmd_Argv(2), sizeof(debug->break_statement));
}
PRVM_UpdateBreakpoints(prog);
}
{
debug_data_t *debug = &debug_data[prog - prvm_prog_list];
- strlcpy(debug->watch_global, Cmd_Argv(2), sizeof(debug->watch_global));
+ dp_strlcpy(debug->watch_global, Cmd_Argv(2), sizeof(debug->watch_global));
}
PRVM_UpdateBreakpoints(prog);
}
{
debug_data_t *debug = &debug_data[prog - prvm_prog_list];
debug->watch_edict = atoi(Cmd_Argv(2));
- strlcpy(debug->watch_field, Cmd_Argv(3), sizeof(debug->watch_field));
+ dp_strlcpy(debug->watch_field, Cmd_Argv(3), sizeof(debug->watch_field));
}
PRVM_UpdateBreakpoints(prog);
}
}
else
{
- strlcpy(buf, "<NO PROG>", bufsize);
+ dp_strlcpy(buf, "<NO PROG>", bufsize);
return;
}
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() == 3)
- strlcpy(cubemapname, Cmd_Argv(2), sizeof(cubemapname));
+ dp_strlcpy(cubemapname, Cmd_Argv(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();
}
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 (showtime.integer)
{
- strlcpy(timestring, Sys_TimeString(showtime_format.string), sizeof(timestring));
+ dp_strlcpy(timestring, Sys_TimeString(showtime_format.string), sizeof(timestring));
fps_strings++;
}
if (showdate.integer)
{
- strlcpy(datestring, Sys_TimeString(showdate_format.string), sizeof(datestring));
+ dp_strlcpy(datestring, Sys_TimeString(showdate_format.string), sizeof(datestring));
fps_strings++;
}
if (showblur.integer)
// probably needs adding a new SUPERCONTENTS type
trace = CL_TraceLine(org, dest, MOVE_NORMAL, NULL, SUPERCONTENTS_SOLID, collision_extendmovelength.value, true, false, NULL, true, true);
if(trace.hittexture)
- strlcpy(texstring, trace.hittexture->name, sizeof(texstring));
+ dp_strlcpy(texstring, trace.hittexture->name, sizeof(texstring));
else
- strlcpy(texstring, "(no texture hit)", sizeof(texstring));
+ dp_strlcpy(texstring, "(no texture hit)", sizeof(texstring));
fps_strings++;
}
if (fps_strings)
while (i < Cmd_Argc ())
{
// Get the name, and appends ".wav" as an extension if there's none
- strlcpy (name, Cmd_Argv (i), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv (i), sizeof (name));
if (!strrchr (name, '.'))
strlcat (name, ".wav", sizeof (name));
i++;
now->rasptr=0;
//sfx->looptstart=0;
//sfx->total_length=0;
- strlcpy (now->name, name, sizeof (now->name));
+ dp_strlcpy (now->name, name, sizeof (now->name));
return now;
}
return NULL;
while (i < Cmd_Argc ())
{
// Get the name, and appends ".wav" as an extension if there's none
- strlcpy (name, Cmd_Argv (i), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv (i), sizeof (name));
if (!strrchr (name, '.'))
strlcat (name, ".wav", sizeof (name));
i++;
// 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;
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;
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);
}
if (name == NULL)
name = "";
// always point the string back at host_client->name to keep it safe
- //strlcpy (host_client->name, name, sizeof (host_client->name));
+ //dp_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));
PRVM_serveredictstring(host_client->edict, netname) = PRVM_SetEngineString(prog, host_client->name);
if (strcmp(host_client->old_name, host_client->name))
{
if (host_client->begun)
SV_BroadcastPrintf("%s ^7changed name to %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, i);
if (model == NULL)
model = "";
// always point the string back at host_client->name to keep it safe
- //strlcpy (host_client->playermodel, model, sizeof (host_client->playermodel));
+ //dp_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
if (skin == NULL)
skin = "";
// always point the string back at host_client->name to keep it safe
- //strlcpy (host_client->playerskin, skin, sizeof (host_client->playerskin));
+ //dp_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]
Download_CheckExtensions();
- strlcpy(host_client->download_name, Cmd_Argv(1), sizeof(host_client->download_name));
+ dp_strlcpy(host_client->download_name, Cmd_Argv(1), sizeof(host_client->download_name));
extension = FS_FileExtension(host_client->download_name);
// host_client is asking to download a specified file
// 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, server, sizeof (sv.name));
- strlcpy(sv.worldname, modelname, sizeof(sv.worldname));
+ dp_strlcpy (sv.name, server, 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_DPrint("Server spawned.\n");
}
// 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+32] = s[ 0] + s[ 1] * 256 + s[ 2] * 65536 + s[ 3] * 16777216;
stats[i+33] = s[ 4] + s[ 5] * 256 + s[ 6] * 65536 + s[ 7] * 16777216;
stats[i+34] = s[ 8] + s[ 9] * 256 + s[10] * 65536 + s[11] * 16777216;
size_t allocsize;
allocsize = GlobalSize (hClipboardData) + 1;
data = (char *)Z_Malloc (allocsize);
- strlcpy (data, cliptext, allocsize);
+ dp_strlcpy (data, cliptext, allocsize);
GlobalUnlock (hClipboardData);
}
}
if (!dllhandle && strrchr(com_argv[0], '/'))
{
char path[MAX_OSPATH];
- strlcpy(path, com_argv[0], sizeof(path));
+ dp_strlcpy(path, com_argv[0], sizeof(path));
strrchr(path, '/')[1] = 0;
for (i = 0; dllnames[i] != NULL; i++)
{
char temp[MAX_OSPATH];
- strlcpy(temp, path, sizeof(temp));
+ dp_strlcpy(temp, path, sizeof(temp));
strlcat(temp, dllnames[i], sizeof(temp));
Con_DPrintf (" \"%s\"", temp);
#ifdef WIN32
size_t allocsize;
allocsize = GlobalSize (hClipboardData) + 1;
data = (char *)Z_Malloc (allocsize);
- strlcpy (data, cliptext, allocsize);
+ dp_strlcpy (data, cliptext, allocsize);
GlobalUnlock (hClipboardData);
}
}
Con_Printf("Unable to open symbol list for %s\n", name);
return false;
}
- strlcpy(gl_driver, name, sizeof(gl_driver));
+ dp_strlcpy(gl_driver, name, sizeof(gl_driver));
Con_Printf("Loading OpenGL driver %s\n", name2);
if (!(cglobj = dlopen(name2, RTLD_LAZY)))
Con_Printf("Unable to open symbol list for %s\n", name);
return false;
}
- strlcpy(gl_driver, name, sizeof(gl_driver));
+ dp_strlcpy(gl_driver, name, sizeof(gl_driver));
return true;
}
Con_Printf("Unable to LoadLibrary %s\n", name);
return false;
}
- strlcpy(gl_driver, name, sizeof(gl_driver));
+ dp_strlcpy(gl_driver, name, sizeof(gl_driver));
return true;
}
{
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;
pool->chain = NULL;
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, sz);
- strlcpy (p, s, sz);
+ dp_strlcpy (p, s, sz);
return p;
}