diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-10-26 21:10:24 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-10-26 21:10:24 +0000 |
commit | 6dc6333323cce1ccc9aaec7ef9e7e200919204e1 (patch) | |
tree | f06f4fc1d5bbcf58364c80e4017d014898714e9c /xmalloc.c | |
parent | 353f2a2ad43256b6b1d8c17e3942316d0a8424e2 (diff) | |
download | rtmux-6dc6333323cce1ccc9aaec7ef9e7e200919204e1.tar.gz rtmux-6dc6333323cce1ccc9aaec7ef9e7e200919204e1.tar.bz2 rtmux-6dc6333323cce1ccc9aaec7ef9e7e200919204e1.zip |
Use strlcpy instead of strncpy, pointed out by deraadt.
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -29,13 +29,14 @@ char * xstrdup(const char *s) { - void *ptr; + char *ptr; size_t len; len = strlen(s) + 1; ptr = xmalloc(len); - return (strncpy(ptr, s, len)); + strlcpy(ptr, s, len); + return (ptr); } void * |