]> Pileus Git - ~andy/fetchmail/blobdiff - strlcpy.c
Credit John Beck's fixes.
[~andy/fetchmail] / strlcpy.c
index fab8dac71bf7478cf3b142f96729d2657614699e..5963dfe323f998a059f8a81d04c1a8414ff6ee12 100644 (file)
--- a/strlcpy.c
+++ b/strlcpy.c
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#if HAVE_NBTOOL_CONFIG_H
-#include "nbtool_config.h"
-#endif
-
-#include <sys/cdefs.h>
-#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 */
-
-#ifdef _LIBC
-#include "namespace.h"
-#endif
 #include <sys/types.h>
 #include <assert.h>
 #include <string.h>
 
-#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 {