chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix the gentoo udev rules to allow the box to boot properly
[elogind.git]
/
klibc
/
klibc
/
strlcpy.c
diff --git
a/klibc/klibc/strlcpy.c
b/klibc/klibc/strlcpy.c
index eb384c9885d2a3710c007375376903f4b1732788..e6937445cd64e5a0a8da91e8cbfeb3924604ad8a 100644
(file)
--- a/
klibc/klibc/strlcpy.c
+++ b/
klibc/klibc/strlcpy.c
@@
-13,13
+13,16
@@
size_t strlcpy(char *dst, const char *src, size_t size)
char ch;
while ( (ch = *p++) ) {
- if ( bytes < size )
+ if ( bytes
+1
< size )
*q++ = ch;
bytes++;
}
- *q = '\0';
+ /* If size == 0 there is no space for a final null... */
+ if ( size )
+ *q = '\0';
+
return bytes;
}