diff options
Diffstat (limited to 'udev_libc_wrapper.c')
-rw-r--r-- | udev_libc_wrapper.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/udev_libc_wrapper.c b/udev_libc_wrapper.c index d69f2ac48e..1852141c93 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__ */ |