1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00

cgtop: fgets() excorcism

This commit is contained in:
Lennart Poettering 2018-10-18 13:34:12 +02:00
parent 741d2cb533
commit 717e419b35

View File

@ -343,10 +343,14 @@ static int process(
} }
for (;;) { for (;;) {
char line[LINE_MAX], *l; _cleanup_free_ char *line = NULL;
uint64_t k, *q; uint64_t k, *q;
char *l;
if (!fgets(line, sizeof(line), f)) r = read_line(f, LONG_LINE_MAX, &line);
if (r < 0)
return r;
if (r == 0)
break; break;
/* Trim and skip the device */ /* Trim and skip the device */