]> Zhao Yanbai Git Server - minix.git/commitdiff
coverity appeasement
authorBen Gras <ben@minix3.org>
Wed, 19 Sep 2012 11:07:18 +0000 (13:07 +0200)
committerBen Gras <ben@minix3.org>
Wed, 19 Sep 2012 11:07:18 +0000 (13:07 +0200)
usr.bin/top/top.c

index ceb5d406ff18ebe7ee562bebfc658bc8b27cdd7f..31d8ddb0bd2efd33d4b4cb00f437c0986c0193cf 100644 (file)
@@ -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;