common CHANGE new ly_strncmp()
compare NULL-terminated reference string with a number of bytes from
other string.
diff --git a/src/xml.c b/src/xml.c
index a08417c..1ce50c0 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -249,7 +249,7 @@
for (u = context->ns.count - 1; u + 1 > 0; --u) {
ns = (struct lyxml_ns *)context->ns.objs[u];
if (prefix && prefix_len) {
- if (ns->prefix && !strncmp(prefix, ns->prefix, prefix_len) && ns->prefix[prefix_len] == '\0') {
+ if (ns->prefix && !ly_strncmp(ns->prefix, prefix, prefix_len)) {
return ns;
}
} else if (!ns->prefix) {