X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstpncpy.c;h=3f7473f946c80ca22541df32a836f86ea74dfda0;hb=dae1457672e2638b0ed8a2f5c4634a30fa86553d;hp=243cbc7bb669076d82db9bde60ee7dcdd48453b4;hpb=1080617a7d04cdf1a1d3b1e390859af371d485d7;p=gnulib.git diff --git a/lib/stpncpy.c b/lib/stpncpy.c index 243cbc7bb..3f7473f94 100644 --- a/lib/stpncpy.c +++ b/lib/stpncpy.c @@ -27,18 +27,21 @@ /* Specification. */ #include "stpncpy.h" -#ifdef _LIBC -# include -#else -# include +#if !HAVE_STPNCPY + +#ifndef _LIBC +/* We cannot generally use the name 'stpncpy' since AIX 4 defines an unusable + variant of the function but we cannot use it. */ +# undef stpncpy +# define stpncpy gnu_stpncpy #endif #ifndef weak_alias # define __stpncpy stpncpy #endif -/* Copy no more than N characters of SRC to DEST, returning the address of - the terminating '\0' in DEST, if any, or else DEST + N. */ +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ char * __stpncpy (char *dest, const char *src, size_t n) { @@ -99,3 +102,5 @@ __stpncpy (char *dest, const char *src, size_t n) #ifdef weak_alias weak_alias (__stpncpy, stpncpy) #endif + +#endif