From 7366a41a054b54a3bbeb9d039ba2462c9772724b Mon Sep 17 00:00:00 2001 From: rbuj Date: Wed, 10 Jun 2020 13:27:39 +0200 Subject: Replace g_malloc0 with g_new0 and g_strdup --- sensors-applet/active-sensor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sensors-applet') 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; } -- cgit v1.2.1