[libfko] use local strndup() if autoconf HAVE_STRNDUP not defined

Blair Zajac reported that strndup() is not available on some PPC systems, so
this commit switches to use the local lib/fko_util.c implementation similarly
to what is done for Windows systems.
This commit is contained in:
Michael Rash
2013-06-10 21:45:31 -04:00
parent 63ecfd54f2
commit 5c7f5f1b0b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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