From 39db9aca78bc69846fcad166190d20e24a55c964 Mon Sep 17 00:00:00 2001 From: Burt P Date: Thu, 26 Dec 2019 02:27:07 -0600 Subject: computer/display: add notes for wanted extern utils Signed-off-by: Burt P --- modules/devices/dmi_memory.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'modules/devices') diff --git a/modules/devices/dmi_memory.c b/modules/devices/dmi_memory.c index 4bb7246e..423b7525 100644 --- a/modules/devices/dmi_memory.c +++ b/modules/devices/dmi_memory.c @@ -977,10 +977,9 @@ gchar *memory_devices_get_system_memory_str() { return ret; } -static gchar *note_state = NULL; +static gchar note_state[note_max_len] = ""; gboolean memory_devices_hinote(const char **msg) { - gchar *want_dmi = _(" dmidecode utility available"); gchar *want_root = _(" ... and HardInfo running with superuser privileges"); gchar *want_eeprom = _(" eeprom module loaded (for SDR, DDR, DDR2, DDR3)"); @@ -991,15 +990,17 @@ gboolean memory_devices_hinote(const char **msg) { gboolean has_eeprom = g_file_test("/sys/bus/i2c/drivers/eeprom", G_FILE_TEST_IS_DIR); gboolean has_ee1004 = g_file_test("/sys/bus/i2c/drivers/ee1004", G_FILE_TEST_IS_DIR); - char *bullet_yes = "\u2713"; - char *bullet_no = "\u2022 "; - - g_free(note_state); - note_state = g_strdup(_("Memory information requires one or both of the following:")); - note_state = appfnl(note_state, "1. %s%s", has_dmi ? bullet_yes : bullet_no, want_dmi); - note_state = appfnl(note_state, " %s%s", has_root ? bullet_yes : bullet_no, want_root); - note_state = appfnl(note_state, "2. %s%s", has_eeprom ? bullet_yes : bullet_no, want_eeprom); - note_state = appfnl(note_state, " %s%s", has_ee1004 ? bullet_yes : bullet_no, want_ee1004); + *note_state = 0; /* clear */ + note_printf(note_state, "%s\n", _("Memory information requires one or both of the following:")); + note_print(note_state, "1. "); + note_cond_bullet(has_dmi, note_state, want_dmi); + note_print(note_state, " "); + note_cond_bullet(has_root, note_state, want_root); + note_print(note_state, "2. "); + note_cond_bullet(has_eeprom, note_state, want_eeprom); + note_print(note_state, " "); + note_cond_bullet(has_ee1004, note_state, want_ee1004); + g_strstrip(note_state); /* remove last \n */ gboolean ddr3_ee1004 = ((dmi_ram_types & (1<