chiark / gitweb /
[PATCH] klibc: version 1.0.5
[elogind.git] / udev_libc_wrapper.c
index d69f2ac48e11dfb0dcc01daa6125089697307b93..1852141c9378c7baa9b389013ed838a90a2d9871 100644 (file)
@@ -58,8 +58,10 @@ size_t strlcpy(char *dst, const char *src, size_t size)
                bytes++;
        }
 
+       /* If size == 0 there is no space for a final null... */
        if (size)
                *q = '\0';
+
        return bytes;
 }
 
@@ -83,8 +85,7 @@ size_t strlcat(char *dst, const char *src, size_t size)
                bytes++;
        }
 
-       if (size)
-               *q = '\0';
+       *q = '\0';
        return bytes;
 }
 #endif /* __OWN_STRLCPYCAT__ */