chiark / gitweb /
[PATCH] klibc: strlcpy/strlcat - don't alter destination if size == 0
[elogind.git] / klibc / klibc / strlcat.c
index f397857e76362f3badc9763f14aa06ba3779a677..fdd72ac392c5b910f19c5e66ecc6227f1577e41a 100644 (file)
@@ -26,7 +26,8 @@ size_t strlcat(char *dst, const char *src, size_t size)
     bytes++;
   }
 
     bytes++;
   }
 
-  *q = '\0';
+  if (size)
+    *q = '\0';
   return bytes;
 }
 
   return bytes;
 }