X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstpncpy.h;h=cf658eb0714e40c5cbaa87ed96847e6aeab3a9e6;hb=55da53d0db0c7a9fd82b2abc809560b3089df6a5;hp=a457ee9d94699030a7eb4eb56c321a78ac05956f;hpb=1080617a7d04cdf1a1d3b1e390859af371d485d7;p=gnulib.git diff --git a/lib/stpncpy.h b/lib/stpncpy.h index a457ee9d9..cf658eb07 100644 --- a/lib/stpncpy.h +++ b/lib/stpncpy.h @@ -18,18 +18,16 @@ #ifndef _STPNCPY_H #define _STPNCPY_H -#if HAVE_STPNCPY - -/* Get stpncpy() declaration. */ #include -#else - -#include +#if !HAVE_STPNCPY -/* Copy no more than N characters of SRC to DST, returning the address of - the last character written into DST. */ -extern char *stpncpy (char *dst, const char *src, size_t n); +/* Copy no more than N bytes of SRC to DST, returning a pointer past the + last non-NUL byte written into DST. */ +/* When not using the GNU libc we use the stpncpy implementation we + provide here. */ +extern char *gnu_stpncpy (char *dst, const char *src, size_t n); +#define stpncpy(Dst, Src, N) gnu_stpncpy (Dst, Src, N) #endif