diff options
author | millert <> | 2001-05-07 15:18:30 +0000 |
---|---|---|
committer | millert <> | 2001-05-07 15:18:30 +0000 |
commit | 083d2dc1a53c9104eecdda36fe77313a5c18c331 (patch) | |
tree | b3fa92c1208ceec9b1cddcce6a91a4abb4e09565 | |
parent | 776e0d42a9e1391c226b0f1eb8ec0701919aebcf (diff) | |
download | openbsd-083d2dc1a53c9104eecdda36fe77313a5c18c331.tar.gz openbsd-083d2dc1a53c9104eecdda36fe77313a5c18c331.tar.bz2 openbsd-083d2dc1a53c9104eecdda36fe77313a5c18c331.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.
-rw-r--r-- | src/lib/libc/string/strlcat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/string/strlcat.c b/src/lib/libc/string/strlcat.c index 39125393ce..39367458f9 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.5 2001/01/13 16:17:24 millert Exp $ */ | 1 | /* $OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 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) |
31 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp $"; | 31 | static char *rcsid = "$OpenBSD: strlcat.c,v 1.6 2001/05/07 15:18:30 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> |
@@ -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(dlen + strlen(s)); | 61 | return(strlen(dst) + strlen(s)); |
62 | while (*s != '\0') { | 62 | while (*s != '\0') { |
63 | if (n != 1) { | 63 | if (n != 1) { |
64 | *d++ = *s; | 64 | *d++ = *s; |