On Sun, May 28, 2006 at 05:52:45PM +0200, Ralf Wildenhues wrote: > > ... AIX strndup is severely broken, at least on 4.3.3 and 5.1, similar > to its strnlen; see also[1]. See for example this test: > > $ cat >a.c <<\EOF > #include <stdio.h> > #include <stdlib.h> > > extern char *strndup (const char *, size_t); > int main() > { > char *s = strndup ("STICKY_OTHER_WRITABLEx", 21); > printf ("%s.\n", s); > free (s); > printf ("%s.\n", strndup("OTHER_WRITABLE 3", 14)); > } > EOF > $ cc -o a a.c && ./a > STICKY_OTHER_WRITABLE. > OTHER_WRITABLERITABLE.
I tried this on AIX 5.2 and it gave the same result. AIX 5.3 didn't though. -- albert chin ([EMAIL PROTECTED]) _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils