summaryrefslogtreecommitdiffstats
path: root/src/cgtop
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgtop')
-rw-r--r--src/cgtop/cgtop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index e34da7cf72..ca51455440 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -310,9 +310,9 @@ static int process(
if (all_unified) {
while (!isempty(l)) {
- if (sscanf(l, "rbytes=%" SCNu64, &k))
+ if (sscanf(l, "rbytes=%" SCNu64, &k) == 1)
rd += k;
- else if (sscanf(l, "wbytes=%" SCNu64, &k))
+ else if (sscanf(l, "wbytes=%" SCNu64, &k) == 1)
wr += k;
l += strcspn(l, WHITESPACE);