Some small fixes found by @jonathangray with cppcheck/scan-build.

This commit is contained in:
Reyk Floeter 2017-06-29 12:48:15 +02:00
commit 2b1181c2ca
3 changed files with 9 additions and 3 deletions

View file

@ -235,7 +235,9 @@ xml_end_element(void *data, const char *el)
struct xml *env = data;
struct xmlelem *xe = env->ox_cur;
if (xe == NULL || strcmp(xe->xe_tag, el) != 0)
if (xe == NULL)
fatal("missing element");
if (strcmp(xe->xe_tag, el) != 0)
fatal("unexpected closing tag: %s <> %s", el, xe->xe_tag);
if (xe->xe_data == NULL)
xe->xe_data = strdup("");