diff options
author | Stefano Karapetsas <[email protected]> | 2012-12-18 01:00:49 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-12-18 01:00:49 +0100 |
commit | 5e29d576c0c137a389a4d686c946a30a20eb40ff (patch) | |
tree | 6029e413bc7a221df140dddb63b187867a2624a5 | |
parent | 68f8b71b075a39dc869a527d83144a2a21e6018f (diff) | |
download | mate-sensors-applet-5e29d576c0c137a389a4d686c946a30a20eb40ff.tar.bz2 mate-sensors-applet-5e29d576c0c137a389a4d686c946a30a20eb40ff.tar.xz |
hddtemp-plugin: Fix string compare
-rw-r--r-- | plugins/hddtemp/hddtemp-plugin.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/hddtemp/hddtemp-plugin.c b/plugins/hddtemp/hddtemp-plugin.c index c7fde43..6822338 100644 --- a/plugins/hddtemp/hddtemp-plugin.c +++ b/plugins/hddtemp/hddtemp-plugin.c @@ -37,6 +37,7 @@ #endif #include <unistd.h> +#include <glib.h> #include "hddtemp-plugin.h" const gchar *plugin_name = "hddtemp"; @@ -147,7 +148,7 @@ static void hddtemp_plugin_get_sensors(GList **sensors) { pv = output_vector = g_strsplit(hddtemp_output, "|", -1); while(pv[1] != NULL) { - if (pv[2] != "" && pv [3] != "" && pv[4] != "" && (!(g_ascii_strcasecmp(pv[2], "???") == 0 || g_ascii_strcasecmp(pv[3], "ERR") == 0 || g_ascii_strcasecmp(pv[4], "*") == 0))) { + if (g_strcmp0(pv[2], "") && g_strcmp0(pv[3], "") && g_strcmp0(pv[4], "") && (!(g_ascii_strcasecmp(pv[2], "???") == 0 || g_ascii_strcasecmp(pv[3], "ERR") == 0 || g_ascii_strcasecmp(pv[4], "*") == 0))) { sensors_applet_plugin_add_sensor(sensors, pv[1], // must be dynamically allocated pv[1], // must be dynamically allocated |