summaryrefslogtreecommitdiff
path: root/udev_libc_wrapper.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-28 00:18:49 +0200
committerGreg KH <gregkh@suse.de>2005-04-26 23:55:00 -0700
commit4f8d44c220d811352b63c65b5a66403339005aac (patch)
treebda99735452286ba436e65d53b7392e83096ef64 /udev_libc_wrapper.c
parent8a4c0c32f4252efb0f0adbf5cdc0261d359cd568 (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.c6
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__ */