]> granicus.if.org Git - file/commitdiff
handle broken strndup on aix
authorChristos Zoulas <christos@zoulas.com>
Wed, 18 Apr 2018 01:16:13 +0000 (01:16 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 18 Apr 2018 01:16:13 +0000 (01:16 +0000)
src/softmagic.c

index 00d5aac6000fcf370b62d17a6991dfe826788008..b418f44aa2de45b8fa7fb68bf6ae4577291eae20 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.259 2018/03/11 01:23:52 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.260 2018/04/18 01:16:13 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -433,8 +433,11 @@ check_fmt(struct magic_set *ms, const char *fmt)
        return rv;
 }
 
-#ifndef HAVE_STRNDUP
-char * strndup(const char *, size_t);
+#if !defined(HAVE_STRNDUP) || defined(__aiws__)
+# ifdef __aiws__
+#  define strndup aix_strndup  /* aix is broken */
+# endif
+char *strndup(const char *, size_t);
 
 char *
 strndup(const char *str, size_t n)