summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-rl.c2
-rw-r--r--cli/src/cli-xml-output.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/cli/src/cli-rl.c b/cli/src/cli-rl.c
index 1bb9bf07c51..215fbebb998 100644
--- a/cli/src/cli-rl.c
+++ b/cli/src/cli-rl.c
@@ -295,6 +295,8 @@ cli_rl_autocomplete_prepare (struct cli_state *state, const char *text)
if (!word)
goto out;
+ if (!tokens)
+ return 0;
matches = cli_rl_get_matches (state, word, token);
state->matches = matches;
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index 4f912f81043..78aa8439e9d 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -2411,10 +2411,10 @@ cli_xml_output_vol_info_option (xmlTextWriterPtr writer, char *substr,
break;
ptr1++;
ptr2++;
- if (!ptr1)
- goto out;
- if (!ptr2)
- goto out;
+ if (!*ptr1)
+ break;
+ if (!*ptr2)
+ break;
}
if (*ptr2 == '\0')
goto out;