diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-06-30 01:31:54 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2007-06-30 01:31:54 +0000 |
commit | 1f101bcb3952ce79440d0236313f3ed11cba2aaa (patch) | |
tree | 43d42b9665f52396b847c169ff4c312a8ecf9a15 /hardinfo2/arch/linux/common/sensors.h | |
parent | 2d366bc8caf8083b66deaa09435f2dc93ffc9a69 (diff) |
Cleanups, fix crashes.
Diffstat (limited to 'hardinfo2/arch/linux/common/sensors.h')
-rw-r--r-- | hardinfo2/arch/linux/common/sensors.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/hardinfo2/arch/linux/common/sensors.h b/hardinfo2/arch/linux/common/sensors.h index 3303d5d2..460c628b 100644 --- a/hardinfo2/arch/linux/common/sensors.h +++ b/hardinfo2/arch/linux/common/sensors.h @@ -162,9 +162,6 @@ static void read_sensors_hwmon(void) read_sensor_labels(driver); } - sensors = g_strdup_printf("%s[Driver Info]\n" - "Name=%s\n", sensors, driver); - sensors = g_strconcat(sensors, "[Cooling Fans]\n", NULL); for (count = 1;; count++) { path_sensor = @@ -258,9 +255,8 @@ static void read_sensors_acpi(void) if ((tz = g_dir_open(path_tz, 0, NULL))) { const gchar *entry; + gchar *temp = ""; - sensors = - g_strdup_printf("%s\n[ACPI Thermal Zone]\n", sensors); while ((entry = g_dir_read_name(tz))) { gchar *path = @@ -272,13 +268,18 @@ static void read_sensors_acpi(void) sscanf(contents, "temperature: %d C", &temperature); - sensors = g_strdup_printf("%s\n%s=%d\302\260C\n", - sensors, entry, temperature); + temp = g_strdup_printf("%s\n%s=%d\302\260C\n", + temp, entry, temperature); g_free(contents); } } + if (*temp != '\0') + sensors = + g_strdup_printf("%s\n[ACPI Thermal Zone]\n%s", + sensors, temp); + g_dir_close(tz); } } |