diff --git a/testchar.c b/testchar.c index d1271fcc..a3f2e4f4 100644 --- a/testchar.c +++ b/testchar.c @@ -672,7 +672,7 @@ testUserEncoding(void) { int totalSize = startSize + textSize + endSize; int k = 0; int i; - int ret = 0; + int ret = 1; buf = xmlMalloc(2 * totalSize); for (i = 0; start[i] != 0; i++) { @@ -693,16 +693,17 @@ testUserEncoding(void) { fprintf(stderr, "failed to parse document\n"); goto error; } - text = doc->children->children->content; + text = doc->children->children->content; for (i = 0; i < textSize; i++) { if (text[i] != 'x') { fprintf(stderr, "text node has wrong content at offset %d\n", k); - ret = 1; goto error; } } + ret = 0; + error: xmlFreeDoc(doc); xmlFree(buf);