summaryrefslogtreecommitdiff
path: root/libelf/elf_errmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/elf_errmsg.c')
-rw-r--r--libelf/elf_errmsg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libelf/elf_errmsg.c b/libelf/elf_errmsg.c
index d6787b1..9fd96bb 100644
--- a/libelf/elf_errmsg.c
+++ b/libelf/elf_errmsg.c
@@ -69,6 +69,10 @@ elf_errmsg(int error)
if (error < 0 || error >= ELF_E_NUM)
return _libelf_errors[ELF_E_NUM];
if (oserr) {
+#if !HAVE_STRLCPY
+# define strlcpy strncpy
+# define strlcat(dst, src, len) strcat(dst, src)
+#endif
strlcpy(LIBELF_PRIVATE(msg), _libelf_errors[error],
sizeof(LIBELF_PRIVATE(msg)));
strlcat(LIBELF_PRIVATE(msg), ": ", sizeof(LIBELF_PRIVATE(msg)));