diff options
-rw-r--r-- | FICS/utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/FICS/utils.c b/FICS/utils.c index b8af230..4ff3972 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -605,8 +605,11 @@ xstrdup(const char *str) if (str == NULL) return NULL; - out = rmalloc(strlen(str) + 1); - return strcpy(out, str); + + const size_t size = strlen(str) + 1; + + out = rmalloc(size); + return memcpy(out, str, size); } PUBLIC char * |