Solving a bug with child count

This commit is contained in:
AnonymusRaccoon
2020-03-03 17:31:28 +01:00
parent 959963b7a8
commit 5028a210a2
+4 -4
View File
@@ -15,10 +15,10 @@ int xml_getchildcount_filtered(node *n, char *name)
if (!n || !n->child) if (!n || !n->child)
return (0); return (0);
n = n->child; n = n->child;
while (n->next) { while (n) {
n = n->next;
if (!my_strcmp(n->name, name)) if (!my_strcmp(n->name, name))
i++; i++;
n = n->next;
} }
return (i); return (i);
} }
@@ -30,9 +30,9 @@ int xml_getchildcount(node *n)
if (!n || !n->child) if (!n || !n->child)
return (0); return (0);
n = n->child; n = n->child;
while (n->next) { while (n) {
n = n->next;
i++; i++;
n = n->next;
} }
return (i); return (i);
} }