diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-10-16 18:01:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-10-17 14:36:54 +0200 |
commit | 0ff6ff2b29dfb02a803515fb0160d9963d2389d5 (patch) | |
tree | 378b5d42024534e03b59fb67034e5f95d3e62e69 /src/cgtop/cgtop.c | |
parent | fileio: add read_stripped_line() as trivial read_line() + strstrip() combo (diff) | |
download | systemd-0ff6ff2b29dfb02a803515fb0160d9963d2389d5.tar.xz systemd-0ff6ff2b29dfb02a803515fb0160d9963d2389d5.zip |
tree-wide: port various parsers over to read_stripped_line()
Diffstat (limited to 'src/cgtop/cgtop.c')
-rw-r--r-- | src/cgtop/cgtop.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 2e517a1636..a6adb8ce31 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -298,15 +298,14 @@ static int process( uint64_t k, *q; char *l; - r = read_line(f, LONG_LINE_MAX, &line); + r = read_stripped_line(f, LONG_LINE_MAX, &line); if (r < 0) return r; if (r == 0) break; - /* Trim and skip the device */ - l = strstrip(line); - l += strcspn(l, WHITESPACE); + /* Skip the device */ + l = line + strcspn(line, WHITESPACE); l += strspn(l, WHITESPACE); if (all_unified) { |