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
parent ed38c2648c
commit acde97a39d
8 changed files with 133 additions and 1 deletions

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,