static void CL_IPLog_Add(const char *address, const char *name, qboolean checkexisting, qboolean addtofile)
{
int i;
+ size_t sz_name, sz_address;
if (!address || !address[0] || !name || !name[0])
return;
if (!cl_iplog_loaded)
Mem_Free(olditems);
}
}
- cl_iplog_items[cl_iplog_numitems].address = (char *) Mem_Alloc(cls.permanentmempool, strlen(address) + 1);
- cl_iplog_items[cl_iplog_numitems].name = (char *) Mem_Alloc(cls.permanentmempool, strlen(name) + 1);
- strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, strlen(address) + 1);
+ sz_address = strlen(address) + 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);
// 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, strlen(name) + 1);
+ strlcpy(cl_iplog_items[cl_iplog_numitems].name, name, sz_name);
cl_iplog_numitems++;
if (addtofile)
{
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(tempstr));
+ 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(tempstr));
+ strlcpy(Nicks_sanlist[0], tempstr, sizeof(Nicks_sanlist[0]));
}
}
p = buf;
while(COM_ParseToken_Console(&p))
{
+ size_t sz = strlen(com_token) + 1; // shut up clang
if(i >= args_left)
break;
- q = (char *)Mem_Alloc(fs_mempool, strlen(com_token) + 1);
- strlcpy(q, com_token, strlen(com_token) + 1);
+ q = (char *)Mem_Alloc(fs_mempool, sz);
+ strlcpy(q, com_token, sz);
new_argv[com_argc + i] = q;
++i;
}