libctf: avoid strndup
Not all platforms have it. Use libiberty xstrndup() instead. (The include of libiberty.h happens in an unusual place due to the requirements of synchronization of most source files between this project and another that does not use libiberty. It serves to pull libiberty.h in for all source files in libctf/, which does the trick.) Tested on x86_64-pc-linux-gnu, x86_64-unknown-freebsd12.0, sparc-sun-solaris2.11, i686-pc-cygwin, i686-w64-mingw32. libctf/ * ctf-decls.h: Include <libiberty.h>. * ctf-lookup.c (ctf_lookup_by_name): Call xstrndup(), not strndup().
This commit is contained in:
parent
595a4d439b
commit
942d35f72b
3 changed files with 7 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include "libiberty.h"
|
||||
|
||||
#if HAVE_QSORT_R_ARG_LAST
|
||||
static inline void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue