From 8d74ec2cc327434cb2d3e5afc106570d757fe023 Mon Sep 17 00:00:00 2001 From: millert <> Date: Mon, 7 May 2001 15:18:30 +0000 Subject: [PATCH] strlcat() should return strlen(dst) + strlen(src) when size parameter <= strlen(dst). Bug report by mark.murnane@ireland.sun.com via the GNOME folks. --- src/lib/libc/string/strlcat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/libc/string/strlcat.c b/src/lib/libc/string/strlcat.c index 39125393..39367458 100644 --- a/src/lib/libc/string/strlcat.c +++ b/src/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 @@ -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 @@ -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;