mirror of
https://github.com/zoriya/xmlParser.git
synced 2026-06-04 18:45:54 +00:00
Solving a bug with child count
This commit is contained in:
+4
-4
@@ -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);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user