diff options
Diffstat (limited to 'src/lib/libc/string/strlcpy.c')
| -rw-r--r-- | src/lib/libc/string/strlcpy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libc/string/strlcpy.c b/src/lib/libc/string/strlcpy.c index 110155f76f..d32b6590f1 100644 --- a/src/lib/libc/string/strlcpy.c +++ b/src/lib/libc/string/strlcpy.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: strlcpy.c,v 1.10 2005/08/08 08:05:37 espie Exp $ */ | 1 | /* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 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> |
| @@ -32,11 +32,11 @@ strlcpy(char *dst, const char *src, size_t siz) | |||
| 32 | size_t n = siz; | 32 | size_t n = siz; |
| 33 | 33 | ||
| 34 | /* Copy as many bytes as will fit */ | 34 | /* Copy as many bytes as will fit */ |
| 35 | if (n != 0 && --n != 0) { | 35 | if (n != 0) { |
| 36 | do { | 36 | while (--n != 0) { |
| 37 | if ((*d++ = *s++) == 0) | 37 | if ((*d++ = *s++) == '\0') |
| 38 | break; | 38 | break; |
| 39 | } while (--n != 0); | 39 | } |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | /* Not enough room in dst, add NUL and traverse rest of src */ | 42 | /* Not enough room in dst, add NUL and traverse rest of src */ |
