summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2014-11-22 10:11:10 +0100
committerLubomir Rintel <lkundrak@v3.sk>2014-11-22 10:27:08 +0100
commit59c469e4d5be44ca28c43317b973f5f704c5fcb6 (patch)
treecf045a5f17755d9e8a47a1635ed4d1de80ae3ad1
parentb93415b2928734ac84b44b32f44d4624b1fd69b0 (diff)
downloadNetworkManager-lr/vpn-fixes-v1.tar.gz
cli: Error out early if we fail parsing header fields and don't handle errorslr/vpn-fixes-v1
This makes it a bit easier to get what the error is in case the problem with header fields is a programming error and not a problem with user-supplied input.
-rw-r--r--clients/cli/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clients/cli/utils.c b/clients/cli/utils.c
index cb8fbf018a..dbb8449514 100644
--- a/clients/cli/utils.c
+++ b/clients/cli/utils.c
@@ -751,6 +751,8 @@ parse_output_fields (const char *fields_str,
/* Field was not found - error case */
if (fields_array[i].name == NULL) {
+ g_assert (error);
+
/* Set GError */
if (!strcasecmp (*iter, "all") || !strcasecmp (*iter, "common"))
g_set_error (error, NMCLI_ERROR, 0, _("field '%s' has to be alone"), *iter);