[Goodies-commits] r5099 - xfce4-sensors-plugin/trunk/panel-plugin
Fabian Nowak
timystery at xfce.org
Tue Jul 15 22:39:34 CEST 2008
Author: timystery
Date: 2008-07-15 20:39:34 +0000 (Tue, 15 Jul 2008)
New Revision: 5099
Modified:
xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
xfce4-sensors-plugin/trunk/panel-plugin/configuration.c
Log:
checked color in acpi to be allocated via g_strdup
Modified: xfce4-sensors-plugin/trunk/panel-plugin/acpi.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/acpi.c 2008-07-15 19:15:17 UTC (rev 5098)
+++ xfce4-sensors-plugin/trunk/panel-plugin/acpi.c 2008-07-15 20:39:34 UTC (rev 5099)
@@ -93,7 +93,7 @@
chipfeature = g_new0 (t_chipfeature, 1);
- chipfeature->color = "#0000B0";
+ chipfeature->color = g_strdup("#0000B0");
chipfeature->address = chip->chip_features->len;
chipfeature->devicename = g_strdup (de->d_name);
chipfeature->name = g_strdup (chipfeature->devicename);
@@ -244,7 +244,7 @@
chipfeature->raw_value = 0.0;
chipfeature->class = ENERGY;
chipfeature->formatted_value = NULL;
- chipfeature->color = "#0000B0";
+ chipfeature->color = g_strdup("#0000B0");
while (fgets (buf, 1024, file)!=NULL)
{
if (strncmp (buf, "design capacity low:", 20)==0)
@@ -362,7 +362,7 @@
chipfeature = g_new0 (t_chipfeature, 1);
- chipfeature->color = "#0000B0";
+ chipfeature->color = g_strdup("#0000B0");
chipfeature->address = chip->chip_features->len;
chipfeature->devicename = g_strdup (de->d_name);
chipfeature->name = g_strdup (chipfeature->devicename);
Modified: xfce4-sensors-plugin/trunk/panel-plugin/configuration.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/configuration.c 2008-07-15 19:15:17 UTC (rev 5098)
+++ xfce4-sensors-plugin/trunk/panel-plugin/configuration.c 2008-07-15 20:39:34 UTC (rev 5099)
@@ -331,18 +331,24 @@
}
else if ((value = xfce_rc_read_entry (rc, "DeviceName", NULL))
&& *value) {
+ /*if (chipfeature->devicename)
+ free (chipfeature->devicename); */
chipfeature->devicename = g_strdup(value);
/* g_free (value); */
}
if ((value = xfce_rc_read_entry (rc, "Name", NULL))
&& *value) {
+ /*if (chipfeature->name)
+ free (chipfeature->name); */
chipfeature->name = g_strdup (value);
/* g_free (value); */
}
if ((value = xfce_rc_read_entry (rc, "Color", NULL))
&& *value) {
+ /* if (chipfeature->color)
+ free (chipfeature->color); */
chipfeature->color = g_strdup (value);
/* g_free (value); */
}
More information about the Goodies-commits
mailing list