chiark / gitweb /
[PATCH] fix klibc's broken strlcpy/strlcat
[elogind.git] / klibc / klibc / strlcpy.c
index eb384c9885d2a3710c007375376903f4b1732788..8b36c43c00cc10e31810fd0a864b25131b370c99 100644 (file)
@@ -13,7 +13,7 @@ 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++;