[cvs-annodex] commit (/annodex): libannodex/trunk/src/libannodex/xtag.c

andre nobody at lists.annodex.net
Wed Sep 1 22:07:44 EST 2004


Update of /annodex (new revision 534)

Modified files:
   libannodex/trunk/src/libannodex/xtag.c

Log Message:
More strcmp(3) guarding



Modified: libannodex/trunk/src/libannodex/xtag.c
===================================================================
--- libannodex/trunk/src/libannodex/xtag.c	2004-09-01 11:57:18 UTC (rev 533)
+++ libannodex/trunk/src/libannodex/xtag.c	2004-09-01 12:07:44 UTC (rev 534)
@@ -397,7 +397,7 @@
     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 DEBUG
 	printf ("got %s expected %s\n", name, tag->name);
 #endif
@@ -541,7 +541,7 @@
 
   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;
     }
   }
@@ -567,7 +567,7 @@
   for (; l; l = l->next) {
     child = (XTag *)l->data;
 
-    if (child->name && !strcmp(child->name, name)) {
+    if (child->name && name && !strcmp(child->name, name)) {
       xtag->current_child = l;
       return child;
     }
@@ -600,7 +600,7 @@
   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;
     }


-- 
andre



More information about the cvs-annodex mailing list