summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
01862db)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7810
d7cf8633-e32d-0410-b094-
e92efae38249
char* Mem_strdup (mempool_t *pool, const char* s)
{
char* p;
char* Mem_strdup (mempool_t *pool, const char* s)
{
char* p;
+ size_t sz = strlen (s) + 1;
if (s == NULL) return NULL;
if (s == NULL) return NULL;
- p = (char*)Mem_Alloc (pool, strlen (s) + 1);
- strcpy (p, s);
+ p = (char*)Mem_Alloc (pool, sz);
+ strlcpy (p, s, sz);