From 7047e014c96a1a17bc3319c29cbadf143e7adf0e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 19 Sep 2012 13:07:18 +0200 Subject: [PATCH] coverity appeasement --- usr.bin/top/top.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index ceb5d406f..31d8ddb0b 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -174,7 +174,9 @@ void parse_file(pid_t pid) } if ((p->p_flags & IS_TASK)) { - fscanf(fp, " %lu ", &p->p_memory); + if(fscanf(fp, " %lu", &p->p_memory) != 1) { + p->p_memory = 0; + } } p->p_flags |= USED; -- 2.11.4.GIT