mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-12 22:40:54 +01:00
Memory (Linux): fallbacks to calcuate ourselves when MemAvailable seems unreasonable
Fixes #1988
This commit is contained in:
1 parent
240ba5c00c
commit
5d8c21a5ca
1 file changed
+1
-1
@@ -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