Add fallback implementation of strndup()

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Linux test code fixed by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Alan Coopersmith 2011-10-24 20:28:32 -07:00
commit acde97a39d
8 changed files with 133 additions and 1 deletions

View file

@ -190,6 +190,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strndup' function. */
#undef HAVE_STRNDUP
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR

View file

@ -492,6 +492,10 @@ extern _X_EXPORT size_t strlcpy(char *dst, const char *src, size_t siz);
extern _X_EXPORT size_t strlcat(char *dst, const char *src, size_t siz);
#endif
#ifndef HAVE_STRNDUP
extern _X_EXPORT char * strndup(const char *str, size_t n);
#endif
/* Logging. */
typedef enum _LogParameter {
XLOG_FLUSH,