diff options
author | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-09-27 14:46:09 +0300 |
---|---|---|
committer | Daniel Teichmann <daniel.teichmann@das-netzwerkteam.de> | 2021-10-01 15:17:27 +0300 |
commit | cb68df149392b0a0a390185176466d44d86e67ce (patch) | |
tree | 4c2e2c9f85c897ededa165b7a810ac0c63d61a6f /plugins | |
parent | 170fbfffb013c1d2f08857f55bd2d44a289810e0 (diff) |
x2go_plugin.c: Declare error string only once per function.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/x2go/x2go_plugin.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/plugins/x2go/x2go_plugin.c b/plugins/x2go/x2go_plugin.c index fc5ccc2fd..ee9267660 100644 --- a/plugins/x2go/x2go_plugin.c +++ b/plugins/x2go/x2go_plugin.c @@ -1259,15 +1259,14 @@ static const RemminaProtocolFeature remmina_plugin_x2go_features[] = { * */ static GError* remmina_plugin_x2go_string_setting_validator(gchar* key, - gchar* value, - gchar* data) { + gchar* value, + gchar* data) { GError *error = NULL; if (!data) { - REMMINA_PLUGIN_CRITICAL("%s", - _("Validation data in ProtocolSettings array is invalid!")); - g_set_error(&error, 1, 1, _("Validation data in ProtocolSettings " - "array is invalid!")); + gchar *error_msg = _("Validation data in ProtocolSettings array is invalid!"); + REMMINA_PLUGIN_CRITICAL("%s", error_msg); + g_set_error(&error, 1, 1, error_msg); return error; } @@ -1276,12 +1275,11 @@ static GError* remmina_plugin_x2go_string_setting_validator(gchar* key, &elements_amount); if (elements_amount <= 0 || elements_list == NULL) { - // Something went wrong, there can't be less than or 0 directions. + // Something went wrong, there can't be less than 1 element! // And elements_list can't be NULL! - REMMINA_PLUGIN_CRITICAL("%s", - _("Validation data in ProtocolSettings array is invalid!")); - g_set_error(&error, 1, 1, _("Validation data in ProtocolSettings " - "array is invalid!")); + gchar *error_msg = _("Validation data in ProtocolSettings array is invalid!"); + REMMINA_PLUGIN_CRITICAL("%s", error_msg); + g_set_error(&error, 1, 1, error_msg); return error; } @@ -1326,10 +1324,9 @@ static GError* remmina_plugin_x2go_int_setting_validator(gchar* key, if (integer_amount != 2 || integer_list == NULL) { // Something went wrong, there can't be more or less than 2 list entries. // And integer_list can't be NULL! - REMMINA_PLUGIN_CRITICAL("%s", - _("Validation data in ProtocolSettings array is invalid!")); - g_set_error(&error, 1, 1, _("Validation data in ProtocolSettings " - "array is invalid!")); + gchar *error_msg = _("Validation data in ProtocolSettings array is invalid!"); + REMMINA_PLUGIN_CRITICAL("%s", error_msg); + g_set_error(&error, 1, 1, error_msg); return error; } |