X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=strlcpy.c;h=c9f0ef2b27b09021cc701866bc85f7770d1d1594;hb=40fe452223b5cc0ff5dbae0efa8551d7e96c1a5c;hp=fab8dac71bf7478cf3b142f96729d2657614699e;hpb=58528fcbcc6c71465dc3a6f0d11df856bbc7f88f;p=~andy%2Ffetchmail diff --git a/strlcpy.c b/strlcpy.c index fab8dac7..c9f0ef2b 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -17,51 +17,28 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -#if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strlcpy.c,v 1.14 2003/10/27 00:12:42 lukem Exp $"); -#endif /* LIBC_SCCS and not lint */ +#include "config.h" +#include "fetchmail.h" -#ifdef _LIBC -#include "namespace.h" -#endif #include #include #include -#ifdef _LIBC -# ifdef __weak_alias -__weak_alias(strlcpy, _strlcpy) -# endif -#endif +#include "fm_strl.h" -#if !HAVE_STRLCPY +#ifndef HAVE_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t -#ifdef _LIBC -_strlcpy(dst, src, siz) -#else -strlcpy(dst, src, siz) -#endif - char *dst; - const char *src; - size_t siz; +strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; - _DIAGASSERT(dst != NULL); - _DIAGASSERT(src != NULL); - /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { do {