xml BUGFIX ly_getutf8 return code check
diff --git a/src/xml.c b/src/xml.c
index b39b3a4..ac1655b 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -606,7 +606,10 @@
     /* parse and store all namespaces */
     prev_input = xmlctx->in->current;
     is_ns = 1;
-    while ((xmlctx->in->current[0] != '\0') && !ly_getutf8(&xmlctx->in->current, &c, &parsed) && is_xmlqnamestartchar(c)) {
+    while ((xmlctx->in->current[0] != '\0') && !(ret = ly_getutf8(&xmlctx->in->current, &c, &parsed))) {
+        if (!is_xmlqnamestartchar(c)) {
+            break;
+        }
         xmlctx->in->current -= parsed;
 
         /* parse attribute name */