diff mbox

[v4,3/4] monitor: Fix failure path for "S" argument type

Message ID 1433302122-27397-4-git-send-email-bsd@redhat.com
State New
Headers show

Commit Message

Bandan Das June 3, 2015, 3:28 a.m. UTC
The "S" argument is only used with ? and we don't
reach it. Fix it nevertheless.

Signed-off-by: Bandan Das <bsd@redhat.com>
---
 monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Markus Armbruster June 3, 2015, 11:32 a.m. UTC | #1
Bandan Das <bsd@redhat.com> writes:

> The "S" argument is only used with ? and we don't
> reach it. Fix it nevertheless.

"and we don't reach it" is confusing.  Suggest

    Since the "S" argument type is only used with the "?" flag, the bug
    can't bite.

With the commit message touched up:

Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index 6777cbe..cbc3cc6 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4069,7 +4069,7 @@  static QDict *monitor_parse_arguments(Monitor *mon,
                 if (len <= 0) {
                     monitor_printf(mon, "%s: string expected\n",
                                    cmd->name);
-                    break;
+                    goto fail;
                 }
                 qdict_put(qdict, key, qstring_from_str(p));
                 p += len;