aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/compat/strlcpy.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-03-18 18:50:21 +0200
committerRiccardo Spagni <ric@spagni.net>2018-03-18 18:50:21 +0200
commit1f6e6001ed37b48788ef071f3297b7e9d67586a5 (patch)
tree7ff391303a4b5643294bc4f91d1c493791f98879 /external/unbound/compat/strlcpy.c
parentMerge pull request #3426 (diff)
parentUnbound: add git submodule for unbound (diff)
downloadmonero-1f6e6001ed37b48788ef071f3297b7e9d67586a5.tar.xz
Merge pull request #2133
efe70a15 Unbound: add git submodule for unbound (anonimal) 84c5a9ba Unbound: remove unbound from in-tree source (anonimal)
Diffstat (limited to 'external/unbound/compat/strlcpy.c')
m---------external/unbound0
-rw-r--r--external/unbound/compat/strlcpy.c57
2 files changed, 0 insertions, 57 deletions
diff --git a/external/unbound b/external/unbound
new file mode 160000
+Subproject 193bdc4ee3fe2b0d17e547e86512528c2614483
diff --git a/external/unbound/compat/strlcpy.c b/external/unbound/compat/strlcpy.c
deleted file mode 100644
index acd306a15..000000000
--- a/external/unbound/compat/strlcpy.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* from openssh 4.3p2 compat/strlcpy.c */
-/*
- * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */
-
-#include <config.h>
-#ifndef HAVE_STRLCPY
-
-#include <sys/types.h>
-#include <string.h>
-
-/*
- * 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
-strlcpy(char *dst, const char *src, size_t siz)
-{
- char *d = dst;
- const char *s = src;
- size_t n = siz;
-
- /* Copy as many bytes as will fit */
- if (n != 0 && --n != 0) {
- do {
- if ((*d++ = *s++) == 0)
- break;
- } while (--n != 0);
- }
-
- /* Not enough room in dst, add NUL and traverse rest of src */
- if (n == 0) {
- if (siz != 0)
- *d = '\0'; /* NUL-terminate dst */
- while (*s++)
- ;
- }
-
- return(s - src - 1); /* count does not include NUL */
-}
-
-#endif /* !HAVE_STRLCPY */