diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-03-28 00:18:49 +0200 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:55:00 -0700 |
commit | 4f8d44c220d811352b63c65b5a66403339005aac (patch) | |
tree | bda99735452286ba436e65d53b7392e83096ef64 /udev_libc_wrapper.c | |
parent | 8a4c0c32f4252efb0f0adbf5cdc0261d359cd568 (diff) |
[PATCH] klibc: strlcpy/strlcat - don't alter destination if size == 0
Diffstat (limited to 'udev_libc_wrapper.c')
-rw-r--r-- | udev_libc_wrapper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/udev_libc_wrapper.c b/udev_libc_wrapper.c index 23cb7b4316..d69f2ac48e 100644 --- a/udev_libc_wrapper.c +++ b/udev_libc_wrapper.c @@ -58,7 +58,8 @@ size_t strlcpy(char *dst, const char *src, size_t size) bytes++; } - *q = '\0'; + if (size) + *q = '\0'; return bytes; } @@ -82,7 +83,8 @@ size_t strlcat(char *dst, const char *src, size_t size) bytes++; } - *q = '\0'; + if (size) + *q = '\0'; return bytes; } #endif /* __OWN_STRLCPYCAT__ */ |