summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strlcat.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-05-07 15:18:30 +0000
committermillert <millert@openbsd.org>2001-05-07 15:18:30 +0000
commitd627c455f2355b5688b408071fef03a23e6dbae2 (patch)
tree5ce0409d2e06087c5b6a67c5554e65540777f40f /lib/libc/string/strlcat.c
parenttunneldelete -> deletetunnel (diff)
downloadwireguard-openbsd-d627c455f2355b5688b408071fef03a23e6dbae2.tar.xz
wireguard-openbsd-d627c455f2355b5688b408071fef03a23e6dbae2.zip
strlcat() should return strlen(dst) + strlen(src) when size parameter
<= strlen(dst). Bug report by mark.murnane@ireland.sun.com via the GNOME folks.
Diffstat (limited to 'lib/libc/string/strlcat.c')
-rw-r--r--lib/libc/string/strlcat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c
index 39125393ced..39367458f96 100644
--- a/lib/libc/string/strlcat.c
+++ b/lib/libc/string/strlcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp $ */
+/* $OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 millert Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp $";
+static char *rcsid = "$OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -58,7 +58,7 @@ size_t strlcat(dst, src, siz)
n = siz - dlen;
if (n == 0)
- return(dlen + strlen(s));
+ return(strlen(dst) + strlen(s));
while (*s != '\0') {
if (n != 1) {
*d++ = *s;