summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormillert <>2001-05-07 15:42:46 +0000
committermillert <>2001-05-07 15:42:46 +0000
commit541e7032b035300e49959a9edfb6a65f778e1b12 (patch)
treee6307104c462118469f170b7439b273e7ce5f3e2
parent083d2dc1a53c9104eecdda36fe77313a5c18c331 (diff)
downloadopenbsd-541e7032b035300e49959a9edfb6a65f778e1b12.tar.gz
openbsd-541e7032b035300e49959a9edfb6a65f778e1b12.tar.bz2
openbsd-541e7032b035300e49959a9edfb6a65f778e1b12.zip
Back out last change, it is intended behavior and update the block
comment to reflect this fact. Too early in the morning for me I guess.
-rw-r--r--src/lib/libc/string/strlcat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libc/string/strlcat.c b/src/lib/libc/string/strlcat.c
index 39367458f9..b8725c37ff 100644
--- a/src/lib/libc/string/strlcat.c
+++ b/src/lib/libc/string/strlcat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 millert Exp $ */ 1/* $OpenBSD: strlcat.c,v 1.7 2001/05/07 15:42:46 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#if defined(LIBC_SCCS) && !defined(lint) 30#if defined(LIBC_SCCS) && !defined(lint)
31static char *rcsid = "$OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 millert Exp $"; 31static char *rcsid = "$OpenBSD: strlcat.c,v 1.7 2001/05/07 15:42:46 millert Exp $";
32#endif /* LIBC_SCCS and not lint */ 32#endif /* LIBC_SCCS and not lint */
33 33
34#include <sys/types.h> 34#include <sys/types.h>
@@ -38,8 +38,8 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 millert Exp
38 * Appends src to string dst of size siz (unlike strncat, siz is the 38 * Appends src to string dst of size siz (unlike strncat, siz is the
39 * full size of dst, not space left). At most siz-1 characters 39 * full size of dst, not space left). At most siz-1 characters
40 * will be copied. Always NUL terminates (unless siz <= strlen(dst)). 40 * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
41 * Returns strlen(initial dst) + strlen(src); if retval >= siz, 41 * Returns strlen(src) + MIN(siz, strlen(initial dst)).
42 * truncation occurred. 42 * If retval >= siz, truncation occurred.
43 */ 43 */
44size_t strlcat(dst, src, siz) 44size_t strlcat(dst, src, siz)
45 char *dst; 45 char *dst;
@@ -58,7 +58,7 @@ size_t strlcat(dst, src, siz)
58 n = siz - dlen; 58 n = siz - dlen;
59 59
60 if (n == 0) 60 if (n == 0)
61 return(strlen(dst) + strlen(s)); 61 return(dlen + strlen(s));
62 while (*s != '\0') { 62 while (*s != '\0') {
63 if (n != 1) { 63 if (n != 1) {
64 *d++ = *s; 64 *d++ = *s;