Skip to content

Commit

Permalink
qjson: Abort earlier on qobject_from_jsonf() misuse
Browse files Browse the repository at this point in the history
Ignoring errors first, then asserting success is suboptimal.  Pass
&error_abort instead, so we abort earlier, and hopefully get more
useful clues on what's wrong.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1488317230-26248-11-git-send-email-armbru@redhat.com>
  • Loading branch information
Markus Armbruster committed Mar 7, 2017
1 parent 53f9915 commit ea5ef5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qobject/qjson.c
Expand Up @@ -65,7 +65,7 @@ QObject *qobject_from_jsonf(const char *string, ...)
va_list ap;

va_start(ap, string);
obj = qobject_from_jsonv(string, &ap, NULL);
obj = qobject_from_jsonv(string, &ap, &error_abort);
va_end(ap);

assert(obj != NULL);
Expand Down

0 comments on commit ea5ef5c

Please sign in to comment.