From: Simo Sorce Date: Wed, 25 Aug 2004 14:24:16 +0000 (+0000) Subject: r2070: Let's try to overload srnlen and strndup for AIX where they are natly broken. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~5868 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98feb3318f54bb48ce56fc8f4721fec4967b9dd9;p=thirdparty%2Fsamba.git r2070: Let's try to overload srnlen and strndup for AIX where they are natly broken. --- diff --git a/source/configure.in b/source/configure.in index d35e89c81f6..4329665ba1a 100644 --- a/source/configure.in +++ b/source/configure.in @@ -1206,6 +1206,8 @@ if test "$enable_shared" = "yes"; then fi AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block]) + AC_DEFINE(BROKEN_STRNLEN,1,[Does strnlen work correctly]) + AC_DEFINE(BROKEN_STRNDUP,1,[Does strndup work correctly]) ;; *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX]) SHLIBEXT="sl" diff --git a/source/lib/util_str.c b/source/lib/util_str.c index 1083076edd4..3e6de23e55d 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -1502,7 +1502,7 @@ int fstr_sprintf(fstring s, const char *fmt, ...) } -#ifndef HAVE_STRNDUP +#if !defined(HAVE_STRNDUP) || defined(BROKEN_STRNDUP) /** Some platforms don't have strndup. **/ @@ -1522,7 +1522,7 @@ int fstr_sprintf(fstring s, const char *fmt, ...) } #endif -#ifndef HAVE_STRNLEN +#if !defined(HAVE_STRNLEN) || defined(BROKEN_STRNLEN) /** Some platforms don't have strnlen **/