summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
authorAmir Shalem <amir@boom.org.il>2005-09-14 14:28:13 +0200
committerKay Sievers <kay.sievers@suse.de>2005-09-14 14:28:13 +0200
commitb4f192f054410bf9ddd04b770f0b46f0fd25abce (patch)
tree724f45ab0d98150a7987b1cc9ae80a8a0f888d88 /udevd.c
parent1ac216b198e559163b1c81eca2f1c9a635d8e326 (diff)
udevd: fix udevd read() calls to leave room for null byte
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/udevd.c b/udevd.c
index 96d4fbb3be..e227a64d71 100644
--- a/udevd.c
+++ b/udevd.c
@@ -195,7 +195,7 @@ static int running_processes(void)
if (f == -1)
return -1;
- len = read(f, buf, sizeof(buf));
+ len = read(f, buf, sizeof(buf)-1);
close(f);
if (len <= 0)
@@ -244,7 +244,7 @@ static int running_processes_in_session(pid_t session, int limit)
if (f == -1)
continue;
- len = read(f, line, sizeof(line));
+ len = read(f, line, sizeof(line)-1);
close(f);
if (len <= 0)