mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 08:13:44 +01:00
Memory (Linux): fallbacks to calcuate ourselves when MemAvailable seems unreasonable
Fixes #1988
This commit is contained in:
@@ -28,7 +28,7 @@ const char* ffDetectMemory(FFMemoryResult* ram)
|
||||
|
||||
if((token = strstr(buf, "MemAvailable:")) != NULL)
|
||||
memAvailable = strtoul(token + strlen("MemAvailable:"), NULL, 10);
|
||||
else
|
||||
if (memAvailable == 0 || memAvailable >= memTotal) // MemAvailable can be unreasonable. #1988
|
||||
{
|
||||
if((token = strstr(buf, "MemFree:")) != NULL)
|
||||
memFree = strtoul(token + strlen("MemFree:"), NULL, 10);
|
||||
|
||||
Reference in New Issue
Block a user