diff --git a/lib/fko_util.c b/lib/fko_util.c index de923657..949af84a 100644 --- a/lib/fko_util.c +++ b/lib/fko_util.c @@ -399,11 +399,11 @@ strtol_wrapper(const char * const str, const int min, } -#ifdef WIN32 +#if defined(WIN32) || !defined(HAVE_STRNDUP) /* Windows does not have strndup, so we well implement it here. * This was the Public Domain C Library (PDCLib). */ -char +char *strndup( const char * s, size_t len ) { char* ns = NULL; diff --git a/lib/fko_util.h b/lib/fko_util.h index 35d29517..9c4d3005 100644 --- a/lib/fko_util.h +++ b/lib/fko_util.h @@ -52,7 +52,7 @@ const char * msg_type_inttostr(const int type); size_t strlcat(char *dst, const char *src, size_t siz); size_t strlcpy(char *dst, const char *src, size_t siz); -#ifdef WIN32 +#if defined(WIN32) || !defined(HAVE_STRNDUP) char * strndup( const char * s, size_t len ); #endif