summaryrefslogtreecommitdiff
path: root/sensors-applet/active-sensor.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-06-10 13:27:39 +0200
committerraveit65 <[email protected]>2020-06-11 15:42:07 +0200
commitfbb4a288d29950be3ae289df130a5ced15658ae8 (patch)
treece546b6be03e5c6fbf08bd2a6cea2a053b5d5de8 /sensors-applet/active-sensor.c
parentcb3dfb26f1ae0f23f1e9ad67a35112ea171a1a90 (diff)
downloadmate-sensors-applet-fbb4a288d29950be3ae289df130a5ced15658ae8.tar.bz2
mate-sensors-applet-fbb4a288d29950be3ae289df130a5ced15658ae8.tar.xz
Replace g_malloc0 with g_new0 and g_strdup
Diffstat (limited to 'sensors-applet/active-sensor.c')
-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;
}