aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/utils.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-06-02 00:57:28 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-06-02 00:57:28 +0200
commit83a9433e7601cbb5d9c3eb835be1185ae69c3bfd (patch)
tree83ce8b215c33214c7ad863fa92ddc9e8ceef5eca /FICS/utils.c
parentbcf882f6d5621317e5b318fc604c1d69bf93f77e (diff)
Switched to usage of memcpy()
Diffstat (limited to 'FICS/utils.c')
-rw-r--r--FICS/utils.c7
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 *