summaryrefslogtreecommitdiff
path: root/openbsd-compat/strlcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/strlcpy.c')
-rw-r--r--openbsd-compat/strlcpy.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/openbsd-compat/strlcpy.c b/openbsd-compat/strlcpy.c
index 679a5b291..b4b1b6015 100644
--- a/openbsd-compat/strlcpy.c
+++ b/openbsd-compat/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>
@@ -37,11 +37,11 @@ strlcpy(char *dst, const char *src, size_t siz)
37 size_t n = siz; 37 size_t n = siz;
38 38
39 /* Copy as many bytes as will fit */ 39 /* Copy as many bytes as will fit */
40 if (n != 0 && --n != 0) { 40 if (n != 0) {
41 do { 41 while (--n != 0) {
42 if ((*d++ = *s++) == 0) 42 if ((*d++ = *s++) == '\0')
43 break; 43 break;
44 } while (--n != 0); 44 }
45 } 45 }
46 46
47 /* Not enough room in dst, add NUL and traverse rest of src */ 47 /* Not enough room in dst, add NUL and traverse rest of src */