virQEMUQAPISchemaTraverse would return previous-to-last queried item on
a query. It would not be a problem if checking if the given path exists
since error reporting works properly but if the caller is interested in
the result, it would be wrong.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
virJSONValuePtr base;
const char *metatype;
- do {
+ while (1) {
if (!(base = virHashLookup(schema, baseName)))
return NULL;
}
query++;
- } while (*query);
+ }
return base;
}