summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ProcessList.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ProcessList.c b/ProcessList.c
index b8a2991b..10ea25a1 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -669,13 +669,12 @@ static void ProcessList_readOomData(Process* process, const char* dirname, const
if (!file)
return;
char buffer[256];
- if (!fgets(buffer, 255, file)) {
- return;
- }
- unsigned int oom;
- int ok = sscanf(buffer, "%u", &oom);
- if (ok >= 1) {
- process->oom = oom;
+ if (fgets(buffer, 255, file)) {
+ unsigned int oom;
+ int ok = sscanf(buffer, "%u", &oom);
+ if (ok >= 1) {
+ process->oom = oom;
+ }
}
fclose(file);
}