xtag_assert_and_pass (parser, X_SLASH);
name = xtag_slurp_to (parser, X_WHITESPACE | X_CLOSETAG, X_NONE);
if (name) {
- if (strcmp (name, tag->name)) {
+ if (name && tag->name && strcmp (name, tag->name)) {
#ifdef XTAG_DEBUG
printf ("got %s expected %s\n", name, tag->name);
#endif
for (l = xtag->attributes; l; l = l->next) {
if ((attr = (XAttribute *)l->data) != NULL) {
- if (!strcmp (attr->name, attribute))
+ if (attr->name && attribute && !strcmp (attr->name, attribute))
return attr->value;
}
}
for (; l; l = l->next) {
child = (XTag *)l->data;
- if (!strcmp(child->name, name)) {
+ if (child->name && name && !strcmp(child->name, name)) {
xtag->current_child = l;
return child;
}
for (; l; l = l->next) {
child = (XTag *)l->data;
- if (!strcmp(child->name, name)) {
+ if (child->name && name && !strcmp(child->name, name)) {
xtag->current_child = l;
return child;
}