chiark / gitweb /
[PATCH] klibc: version 1.0.5
[elogind.git] / klibc / klibc / strlcpy.c
index 9e7b6bf91fa692779bcc7b7517bc4471c6695e49..e6937445cd64e5a0a8da91e8cbfeb3924604ad8a 100644 (file)
@@ -19,8 +19,10 @@ size_t strlcpy(char *dst, const char *src, size_t size)
     bytes++;
   }
 
-  if (size)
+  /* If size == 0 there is no space for a final null... */
+  if ( size )
     *q = '\0';
+
   return bytes;
 }