diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 20f9816efd..f48ad5b213 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,8 @@ +2019-06-06 Nick Alcock + + * ctf-decls.h: Include . + * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup(). + 2019-06-06 Nick Alcock * ctf-dump.c (ctf_dump_format_type): Cast size_t's used in printf()s. diff --git a/libctf/ctf-decls.h b/libctf/ctf-decls.h index c840b793c9..b60a48f987 100644 --- a/libctf/ctf-decls.h +++ b/libctf/ctf-decls.h @@ -24,6 +24,7 @@ #include #include +#include "libiberty.h" #if HAVE_QSORT_R_ARG_LAST static inline void diff --git a/libctf/ctf-lookup.c b/libctf/ctf-lookup.c index ab12715f4b..4089ad9ffa 100644 --- a/libctf/ctf-lookup.c +++ b/libctf/ctf-lookup.c @@ -153,7 +153,7 @@ ctf_lookup_by_name (ctf_file_t *fp, const char *name) else { free (fp->ctf_tmp_typeslice); - fp->ctf_tmp_typeslice = strndup (p, (size_t) (q - p)); + fp->ctf_tmp_typeslice = xstrndup (p, (size_t) (q - p)); if (fp->ctf_tmp_typeslice == NULL) { (void) ctf_set_errno (fp, ENOMEM);