From b9a937bf6a343e90d75c964d452fca9986361ff8 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 5 Sep 2014 22:26:03 -0500 Subject: [PATCH] xml.c: Simplify node_get_string() --- src/xml.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/xml.c b/src/xml.c index 5351c2c2..dc910f37 100644 --- a/src/xml.c +++ b/src/xml.c @@ -272,21 +272,13 @@ static int node_get_string(const xmlNode *string_node, tchar **tstr_ret) { xmlNode *child; - tchar *tstr = NULL; - int ret; if (*tstr_ret) return 0; - for_node_child(string_node, child) { - if (node_is_text(child) && child->content) { - ret = utf8_to_tstr_simple(child->content, &tstr); - if (ret) - return ret; - break; - } - } - *tstr_ret = tstr; + for_node_child(string_node, child) + if (node_is_text(child) && child->content) + return utf8_to_tstr_simple(child->content, tstr_ret); return 0; } -- 2.43.0