[Goodies-commits] r3757 - xfce4-sensors-plugin/trunk/panel-plugin

Fabian Nowak timystery at xfce.org
Fri Dec 28 23:08:55 CET 2007


Author: timystery
Date: 2007-12-28 22:08:55 +0000 (Fri, 28 Dec 2007)
New Revision: 3757

Modified:
   xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c
Log:
Ignore md* and check for strlen(standard_out)>0 before converting with atoi.


Modified: xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c	2007-12-28 00:08:48 UTC (rev 3756)
+++ xfce4-sensors-plugin/trunk/panel-plugin/hddtemp.c	2007-12-28 22:08:55 UTC (rev 3757)
@@ -122,6 +122,7 @@
     while ( (dirname = g_dir_read_name (gdir))!=NULL ) {
         if ( strncmp (dirname, "ram", 3)!=0 &&
              strncmp (dirname, "loop", 4)!=0 &&
+             strncmp (dirname, "md", 2)!=0 &&
              strncmp (dirname, "dm-", 3)!=0 ) {
             /* TODO: look, if /dev/dirname exists? */
             chipfeature = g_new0 (t_chipfeature, 1);
@@ -322,13 +323,15 @@
         quick_message (msg_text);
         value = 0.0;
     }
-    else
+    else if ( strlen(standard_output) > 0)
     {
         /* hddtemp does not return floating values, but only integer ones.
           So have an easier life with atoi.
           FIXME: Use strtod() instead?*/
         value = (double) (atoi ( (const char*) standard_output) );
     }
+    else
+        value = 0.0;
 
     g_free (cmd_line);
     g_free (standard_output);




More information about the Goodies-commits mailing list