diff options
| author | Burt P <pburt0@gmail.com> | 2019-12-23 23:27:38 -0600 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-12-26 17:36:37 -0800 | 
| commit | 6f43c5ce0695bd12bc399ab730857c6389a9d7f4 (patch) | |
| tree | 24367274a87fa8140130bac7cb55c5c6cc347c81 /modules | |
| parent | 39db9aca78bc69846fcad166190d20e24a55c964 (diff) | |
memory devices: use "RAM" for unknown ram type instead of (Unknown)
ex: "16 GiB DDR4 SDRAM", when type is known,
or just "16 GiB RAM" when it isn't. (formerly "16 GiB (Unknown)")
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/devices/dmi_memory.c | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/modules/devices/dmi_memory.c b/modules/devices/dmi_memory.c index 423b7525..07113b52 100644 --- a/modules/devices/dmi_memory.c +++ b/modules/devices/dmi_memory.c @@ -52,6 +52,7 @@ static const char mem_icon[] = "memory.png";  static const char array_icon[] = "devices.png";  static const char empty_icon[] = "module.png"; +#define UNKNOWN_MEM_TYPE_STRING _("RAM")  #define UNKIFNULL2(f) ((f) ? f : _("(Unknown)"))  #define UNKIFEMPTY2(f) ((*f) ? f : _("(Unknown)"))  #define STR_IGNORE(str, ignore) if (SEQ(str, ignore)) { *str = 0; null_if_empty(&str); } @@ -953,7 +954,11 @@ gchar *memory_devices_get_system_memory_types_str() {          if (rtypes & bit)              types_str = appfsp(types_str, "%s", GET_RAM_TYPE_STR(i));      } -    ret = g_strdup(UNKIFNULL2(types_str)); + +    if (types_str) +        ret = g_strdup(types_str); +    else +        ret = g_strdup(UNKNOWN_MEM_TYPE_STRING);      g_free(types_str);      return ret;  } | 
