From 83a9433e7601cbb5d9c3eb835be1185ae69c3bfd Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 2 Jun 2024 00:57:28 +0200 Subject: Switched to usage of memcpy() --- FICS/utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'FICS') 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 * -- cgit v1.2.3