X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstpncpy.c;h=3f7473f946c80ca22541df32a836f86ea74dfda0;hb=0df2580e13bb5523b7f5569e9bec1fda9c812677;hp=c302e398d72fc0d407e709a72ac9bf302e715951;hpb=fa9635f22ac175bace582885ca780d3eb511b578;p=gnulib.git diff --git a/lib/stpncpy.c b/lib/stpncpy.c index c302e398d..3f7473f94 100644 --- a/lib/stpncpy.c +++ b/lib/stpncpy.c @@ -27,12 +27,21 @@ /* Specification. */ #include "stpncpy.h" +#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) { @@ -93,3 +102,5 @@ __stpncpy (char *dest, const char *src, size_t n) #ifdef weak_alias weak_alias (__stpncpy, stpncpy) #endif + +#endif