aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-04-10 17:54:34 +0200
committerPřemysl Eric Janouch <p@janouch.name>2024-04-10 17:54:34 +0200
commit8386af0420741d4baa9a41db19f6115acff6ef8e (patch)
treea6d4ec9b3dcdd97beae2ff64e8e5334ed75c784a
parentf04cc2c61e1a00db4d1af1bb55ca7e20b9c3db23 (diff)
downloadliberty-8386af0420741d4baa9a41db19f6115acff6ef8e.tar.gz
liberty-8386af0420741d4baa9a41db19f6115acff6ef8e.tar.xz
liberty-8386af0420741d4baa9a41db19f6115acff6ef8e.zip
Silence an OpenBSD linker warning
-rw-r--r--liberty.c3
1 files changed, 2 insertions, 1 deletions
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 *