[evolution-rss/evolution-rss-0-2-0] do not pass empty string to strcasecmp



commit c701d50cadc8b43f939b00375c5a173e3775db9b
Author: Lucian Langa <lucilanga gnome org>
Date:   Wed Jan 26 17:02:37 2011 +0200

    do not pass empty string to strcasecmp

 src/parser.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/parser.c b/src/parser.c
index ea673c1..2088b01 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -689,10 +689,15 @@ layer_query_find_prop (xmlNodePtr node,
 		xmlChar *prop)
 {
 	while (node!=NULL) {
-		if (!g_ascii_strcasecmp((gchar *)node->name, match)
-		&& (!g_ascii_strcasecmp((gchar *)xmlGetProp(node, attr), attrprop)
-		   || !xmlGetProp(node, attr)))
-					return (gchar *)xmlGetProp(node, prop);
+		if (!g_ascii_strcasecmp((gchar *)node->name, match)) {
+			gchar *tprop = (gchar *)xmlGetProp(node, attr);
+			if (tprop) {
+				if (g_ascii_strcasecmp(tprop, attrprop))
+					break;
+			}
+			xmlFree(tprop);
+		return (gchar *)xmlGetProp(node, prop);
+		}
 		node = node->next;
 	}
 	return NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]