From 8386af0420741d4baa9a41db19f6115acff6ef8e Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Wed, 10 Apr 2024 17:54:34 +0200 Subject: Silence an OpenBSD linker warning --- liberty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/liberty.c b/liberty.c index 390d40b..b03e3fa 100644 --- a/liberty.c +++ b/liberty.c @@ -292,7 +292,8 @@ xreallocarray (void *o, size_t n, size_t m) static char * xstrdup (const char *s) { - return strcpy (xmalloc (strlen (s) + 1), s); + size_t len = strlen (s) + 1; + return memcpy (xmalloc (len), s, len); } static char * -- cgit v1.2.3-70-g09d2