summaryrefslogtreecommitdiff
path: root/sensors-applet
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-06-10 13:27:39 +0200
committerraveit65 <[email protected]>2020-06-11 12:59:06 +0200
commit7366a41a054b54a3bbeb9d039ba2462c9772724b (patch)
tree8fdf24ee0792ed2ecfd635803efb5aacffd49a57 /sensors-applet
parentc97ade764ed2c0f69beeb77663d7143e429fa6e9 (diff)
downloadmate-sensors-applet-7366a41a054b54a3bbeb9d039ba2462c9772724b.tar.bz2
mate-sensors-applet-7366a41a054b54a3bbeb9d039ba2462c9772724b.tar.xz
Replace g_malloc0 with g_new0 and g_strdup
Diffstat (limited to 'sensors-applet')
-rw-r--r--sensors-applet/active-sensor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sensors-applet/active-sensor.c b/sensors-applet/active-sensor.c
index 27619ac..7cf9df5 100644
--- a/sensors-applet/active-sensor.c
+++ b/sensors-applet/active-sensor.c
@@ -378,14 +378,14 @@ static void active_sensor_set_graph_dimensions(ActiveSensor *as,
old_num_samples = as->num_samples;
as->num_samples = num_samples;
- as->sensor_values = g_malloc0(sizeof(gdouble)*as->num_samples);
+ as->sensor_values = g_new0 (gdouble, as->num_samples);
memcpy(as->sensor_values,
old_values,
MIN(old_num_samples, as->num_samples)*sizeof(gdouble));
g_free(old_values);
} else {
- as->sensor_values = g_malloc0(sizeof(gdouble)*num_samples);
+ as->sensor_values = g_new0 (gdouble, num_samples);
as->num_samples = num_samples;
}