i686-gentoo-freebsd7.0-gcc -O2 -pipe paxelf.o paxinc.o xfuncs.o scanelf.o -o scanelf scanelf.o: In function `scanelf_file_sym': scanelf.c:(.text+0xe10): undefined reference to `strndup' scanelf.c:(.text+0x1060): undefined reference to `strndup' collect2: ld returned 1 exit status gmake: *** [scanelf] Error 1 strlcpy would be a better alternative.
eh? strndup and strlcpy are 2 completely different functions. With that said strndup() is a handy function. BSD you probably want to make an additionly function that does what strndup() does.
Didn't see the previous bug filed, changing this one to duplicate of 249731. And, it's not only BSD. Every other non-gnu operating system most likely won't have a strndup(). *** This bug has been marked as a duplicate of bug 249731 ***
strndup() is in POSIX, strlcpy() isnt ... nor is it in glibc ... besides, you can blame Diego for it ;)
(In reply to comment #3) > strndup() is in POSIX, strlcpy() isnt ... nor is it in glibc ... > Yeah, sorry, I mixed up the names with strncpy. > besides, you can blame Diego for it ;) > lol?