diff --git a/include/lib/libc/string.h b/include/lib/libc/string.h index 3c8e3b6..ee6eeac 100644 --- a/include/lib/libc/string.h +++ b/include/lib/libc/string.h @@ -28,5 +28,6 @@ size_t strlen(const char *s); size_t strnlen(const char *s, size_t maxlen); char *strrchr(const char *p, int ch); +size_t strlcpy(char * dst, const char * src, size_t dsize); #endif /* STRING_H */ diff --git a/lib/libc/libc.mk b/lib/libc/libc.mk index daa2ec1..1276f5c 100644 --- a/lib/libc/libc.mk +++ b/lib/libc/libc.mk @@ -19,6 +19,7 @@ snprintf.c \ strchr.c \ strcmp.c \ + strlcpy.c \ strlen.c \ strncmp.c \ strnlen.c \ diff --git a/lib/libc/strlcpy.c b/lib/libc/strlcpy.c index 019d231..c4f39bb 100644 --- a/lib/libc/strlcpy.c +++ b/lib/libc/strlcpy.c @@ -1,6 +1,8 @@ /* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */ /* + * SPDX-License-Identifier: ISC + * * Copyright (c) 1998, 2015 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -16,10 +18,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -__FBSDID("$FreeBSD$"); - -#include +#include #include /* @@ -28,7 +27,7 @@ * Returns strlen(src); if retval >= dsize, truncation occurred. */ size_t -strlcpy(char * __restrict dst, const char * __restrict src, size_t dsize) +strlcpy(char * dst, const char * src, size_t dsize) { const char *osrc = src; size_t nleft = dsize;