mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-24 15:15:44 +00:00
SysArchMeter: skip "n/a" values
Unavailable values are returned as "n/a" from lsb_release, skip these. $ lsb_release -a LSB Version: 1.4 Distributor ID: Arch Description: Arch Linux Release: rolling Codename: n/a
This commit is contained in:
parent
8fb51627b2
commit
85a855f5b2
@ -38,6 +38,11 @@ static void SysArchMeter_updateValues(Meter* this, char* buffer, size_t size) {
|
||||
char* value = String_trim(&line[n + 1]);
|
||||
line[n] = '\0';
|
||||
|
||||
if(String_eq(value, "n/a")) {
|
||||
free(value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(String_eq(line, "Distributor ID"))
|
||||
snprintf(distro[0], sizeof(distro[0]), "%s", value);
|
||||
else if(String_eq(line, "Release"))
|
||||
|
Loading…
Reference in New Issue
Block a user