diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2020-05-17 11:40:45 -0700 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2020-05-17 11:40:45 -0700 |
commit | 8190734fe0fd5a589fb16b17abfcf3dea31a8a62 (patch) | |
tree | 53c82a21d67a013f993902a5b771ce6b745d8330 /modules | |
parent | 9113356173ed569ce22573dc6d1e05c922bf2340 (diff) |
Fix more formatting errors
Diffstat (limited to 'modules')
-rw-r--r-- | modules/devices/battery.c | 4 | ||||
-rw-r--r-- | modules/devices/storage.c | 7 | ||||
-rw-r--r-- | modules/devices/x86/processor.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/modules/devices/battery.c b/modules/devices/battery.c index 6d50a52d..d2b7189c 100644 --- a/modules/devices/battery.c +++ b/modules/devices/battery.c @@ -82,9 +82,9 @@ __scan_battery_apcupsd(void) battery_list = h_strdup_cprintf("[%s]\n", battery_list, ups_fields[i].key); } else { /* there's a name: adds a line */ + const gchar *name = g_hash_table_lookup(ups_data, ups_fields[i].key); battery_list = h_strdup_cprintf("%s=%s\n", battery_list, - ups_fields[i].name, - g_hash_table_lookup(ups_data, ups_fields[i].key)); + ups_fields[i].name, name); } } diff --git a/modules/devices/storage.c b/modules/devices/storage.c index 4272430d..d9c8e043 100644 --- a/modules/devices/storage.c +++ b/modules/devices/storage.c @@ -307,7 +307,7 @@ gboolean __scan_udisks2_devices(void) { moreinfo = h_strdup_cprintf(_("[Self-monitoring (S.M.A.R.T.)]\n" "Status=%s\n" "Bad Sectors=%ld\n" - "Power on time=%d days %d hours\n" + "Power on time=%lu days %lu hours\n" "Temperature=%d°C\n"), moreinfo, disk->smart_failing ? _("Failing"): _("OK"), @@ -542,7 +542,8 @@ void __scan_scsi_devices(void) void __scan_ide_devices(void) { FILE *proc_ide; - gchar *device, iface, *model, *media, *pgeometry = NULL, *lgeometry = NULL; + gchar *device, *model, *media, *pgeometry = NULL, *lgeometry = NULL; + gchar iface; gint n = 0, i = 0, cache, nn = 0; gchar *capab = NULL, *speed = NULL, *driver = NULL, *ide_storage_list; @@ -690,7 +691,7 @@ void __scan_ide_devices(void) gchar *devid = g_strdup_printf("IDE%d", n); - ide_storage_list = h_strdup_cprintf("$%s$%hd%c=|%s\n", ide_storage_list, devid, iface, model); + ide_storage_list = h_strdup_cprintf("$%s$hd%c=|%s\n", ide_storage_list, devid, iface, model); storage_icons = h_strdup_cprintf("Icon$%s$%s=%s.png\n", storage_icons, devid, model, g_str_equal(media, "cdrom") ? "cdrom" : "hdd"); diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c index 1985d12a..ff1374f3 100644 --- a/modules/devices/x86/processor.c +++ b/modules/devices/x86/processor.c @@ -704,7 +704,7 @@ gchar *dmi_socket_info() { gchar *voltage_str = dmidecode_match("Voltage", &dt, &h); gchar *max_speed_str = dmidecode_match("Max Speed", &dt, &h); - ret = h_strdup_cprintf("[%s (%lu) %s]\n" + ret = h_strdup_cprintf("[%s (%d) %s]\n" "%s=0x%x\n" "%s=%s\n" "%s=%s\n" |