[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 04/11: null-pointer checks
noreply at xfce.org
noreply at xfce.org
Tue Mar 7 23:38:28 CET 2017
This is an automated email from the git hooks/post-receive script.
timystery pushed a commit to branch master
in repository panel-plugins/xfce4-sensors-plugin.
commit 223949795de7d4e10f13add8c0f1dd56d9c65771
Author: Fabian <timystery at arcor.de>
Date: Mon Mar 6 23:31:46 2017 +0100
null-pointer checks
---
lib/sensors-interface-common.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c
index a87c791..9b8e987 100644
--- a/lib/sensors-interface-common.c
+++ b/lib/sensors-interface-common.c
@@ -45,6 +45,9 @@ sensors_new (XfcePanelPlugin *plugin, gchar *plugin_config_file)
TRACE ("enters sensors_new");
+ g_return_val_if_fail(plugin!=NULL, NULL);
+ g_return_val_if_fail(plugin_config_file!=NULL, NULL);
+
sensors = g_new0 (t_sensors, 1);
sensors->plugin_config_file = plugin_config_file; /* important as we check against NULL frequently */
@@ -101,6 +104,9 @@ sensors_init_default_values (t_sensors *sensors, XfcePanelPlugin *plugin)
{
TRACE ("enters sensors_init_default_values");
+ g_return_if_fail(sensors!=NULL);
+ g_return_if_fail(plugin!=NULL);
+
sensors->show_title = TRUE;
sensors->show_labels = TRUE;
sensors->display_values_type = DISPLAY_TEXT;
@@ -141,6 +147,8 @@ format_sensor_value (t_tempscale scale, t_chipfeature *chipfeature,
double sensorFeature, gchar **help)
{
/* TRACE ("enters format_sensor_value"); */
+ g_return_if_fail(chipfeature!=NULL);
+ g_return_if_fail(*help!=NULL);
switch (chipfeature->class) {
case TEMPERATURE:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list