summaryrefslogtreecommitdiff
path: root/udev_libc_wrapper.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-08-08 02:21:55 +0200
committerKay Sievers <kay.sievers@suse.de>2005-08-08 02:21:55 +0200
commit13d11705bf0117365afc3f9210f4d568a2baa69c (patch)
treeed8d587b482e42072f51190bc8f8edc13e87dba5 /udev_libc_wrapper.c
parent738428b4499211247dafa394805ecaa2cb313f03 (diff)
switch some strlcpy's to memcpy
strlcpy counts the sourec string lengt and is therefore not suitable to copy a defined length of characters from one string to another. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_libc_wrapper.c')
-rw-r--r--udev_libc_wrapper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/udev_libc_wrapper.c b/udev_libc_wrapper.c
index 1852141c93..4e9f9f1fe8 100644
--- a/udev_libc_wrapper.c
+++ b/udev_libc_wrapper.c
@@ -159,7 +159,8 @@ static unsigned long get_id_by_name(const char *uname, const char *dbfile)
if (count >= sizeof(line))
continue;
- strlcpy(line, bufline, count);
+ memcpy(line, bufline, count-1);
+ line[count-1] = '\0';
pos = line;
/* get name */