From: kay.sievers@vrfy.org Date: Tue, 29 Mar 2005 01:53:45 +0000 (+0200) Subject: [PATCH] klibc: version 1.0.5 X-Git-Tag: 057~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12340f41085c5ab9f5f049eab640835e39de8286;p=systemd [PATCH] klibc: version 1.0.5 --- diff --git a/klibc/klibc/strlcat.c b/klibc/klibc/strlcat.c index fdd72ac3..f397857e 100644 --- a/klibc/klibc/strlcat.c +++ b/klibc/klibc/strlcat.c @@ -26,8 +26,7 @@ size_t strlcat(char *dst, const char *src, size_t size) bytes++; } - if (size) - *q = '\0'; + *q = '\0'; return bytes; } diff --git a/klibc/klibc/strlcpy.c b/klibc/klibc/strlcpy.c index 9e7b6bf9..e6937445 100644 --- a/klibc/klibc/strlcpy.c +++ b/klibc/klibc/strlcpy.c @@ -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; } diff --git a/klibc/version b/klibc/version index ee90284c..90a27f9c 100644 --- a/klibc/version +++ b/klibc/version @@ -1 +1 @@ -1.0.4 +1.0.5 diff --git a/udev_libc_wrapper.c b/udev_libc_wrapper.c index d69f2ac4..1852141c 100644 --- a/udev_libc_wrapper.c +++ b/udev_libc_wrapper.c @@ -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__ */