19 lines
500 B
Diff
19 lines
500 B
Diff
|
Index: src/killall5.c
|
||
|
===================================================================
|
||
|
--- src/killall5.c (revision 116)
|
||
|
+++ src/killall5.c (working copy)
|
||
|
@@ -508,9 +508,11 @@
|
||
|
|
||
|
/* Read SID & statname from it. */
|
||
|
if ((fp = fopen(path, "r")) != NULL) {
|
||
|
- if (!fgets(buf, sizeof(buf), fp))
|
||
|
- buf[0] = '\0';
|
||
|
+ size_t len;
|
||
|
|
||
|
+ len = fread(buf, sizeof(char), sizeof(buf)-1, fp);
|
||
|
+ buf[len] = '\0';
|
||
|
+
|
||
|
if (buf[0] == '\0') {
|
||
|
nsyslog(LOG_ERR,
|
||
|
"can't read from %s\n", path);
|