1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-18 00:23:50 +03:00

r18970: avoid strndup and strnlen on AIX. They are quite broken. See

http://lists.samba.org/archive/samba-technical/2004-August/036915.html
This commit is contained in:
Andrew Tridgell
2006-09-28 06:43:27 +00:00
committed by Gerald (Jerry) Carter
parent 27114fe175
commit c178c84f01
2 changed files with 6 additions and 2 deletions

View File

@@ -66,6 +66,8 @@ case "$host_os" in
fi
;;
*aix*)
AC_DEFINE(BROKEN_STRNDUP, 1, [Whether strndup is broken])
AC_DEFINE(BROKEN_STRNLEN, 1, [Whether strnlen is broken])
if test "${GCC}" != "yes"; then
## for funky AIX compiler using strncpy()
CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"

View File

@@ -121,12 +121,14 @@ size_t rep_strlcpy(char *d, const char *s, size_t bufsize);
size_t rep_strlcat(char *d, const char *s, size_t bufsize);
#endif
#ifndef HAVE_STRNDUP
#if (defined(BROKEN_STRNDUP) || !defined(HAVE_STRNDUP))
#undef HAVE_STRNDUP
#define strndup rep_strndup
char *rep_strndup(const char *s, size_t n);
#endif
#ifndef HAVE_STRNLEN
#if (defined(BROKEN_STRNLEN) || !defined(HAVE_STRNLEN))
#undef HAVE_STRNLEN
#define strnlen rep_strnlen
size_t rep_strnlen(const char *s, size_t n);
#endif