diff --git a/ext/libelf/SConscript b/ext/libelf/SConscript index 41627e90c..1e7fbb465 100644 --- a/ext/libelf/SConscript +++ b/ext/libelf/SConscript @@ -40,6 +40,8 @@ ElfFile('elf_begin.c') ElfFile('elf_cntl.c') ElfFile('elf_data.c') ElfFile('elf_end.c') +ElfFile('elf_errmsg.c') +ElfFile('elf_errno.c') ElfFile('elf_fill.c') ElfFile('elf_flag.c') ElfFile('elf_getarhdr.c') diff --git a/ext/libelf/_libelf.h b/ext/libelf/_libelf.h index a811abb1a..f6cec6e32 100644 --- a/ext/libelf/_libelf.h +++ b/ext/libelf/_libelf.h @@ -30,6 +30,7 @@ #define __LIBELF_H_ #include "elf_queue.h" +#include "libelf.h" #ifndef NULL #define NULL ((void *) 0) diff --git a/ext/libelf/elf_errmsg.c b/ext/libelf/elf_errmsg.c index 88607ebf4..5fafd5f5d 100644 --- a/ext/libelf/elf_errmsg.c +++ b/ext/libelf/elf_errmsg.c @@ -71,10 +71,10 @@ elf_errmsg(int error) if (error < 0 || error >= ELF_E_NUM) return _libelf_errors[ELF_E_NUM]; if (oserr) { - strlcpy(LIBELF_PRIVATE(msg), _libelf_errors[error], + strncpy(LIBELF_PRIVATE(msg), _libelf_errors[error], sizeof(LIBELF_PRIVATE(msg))); - strlcat(LIBELF_PRIVATE(msg), ": ", sizeof(LIBELF_PRIVATE(msg))); - strlcat(LIBELF_PRIVATE(msg), strerror(oserr), + strncat(LIBELF_PRIVATE(msg), ": ", sizeof(LIBELF_PRIVATE(msg))); + strncat(LIBELF_PRIVATE(msg), strerror(oserr), sizeof(LIBELF_PRIVATE(msg))); return (const char *)&LIBELF_PRIVATE(msg); }