[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:
+2
-2
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user