From: Ben Gras Date: Wed, 19 Sep 2012 11:07:18 +0000 (+0200) Subject: coverity appeasement X-Git-Tag: v3.2.1~318 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/CHANGES?a=commitdiff_plain;h=7047e014c96a1a17bc3319c29cbadf143e7adf0e;p=minix.git coverity appeasement --- 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;