From 45b37ccbd4ec2b24ab6d5627dbf9bd48255f729b Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 17 Jul 2009 18:18:47 +0000 Subject: Error checking for string comparisons. svn path=/trunk/libcss/; revision=8608 --- src/select/hash.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/select/hash.c b/src/select/hash.c index 5bdd22f..9bcfb15 100644 --- a/src/select/hash.c +++ b/src/select/hash.c @@ -10,6 +10,7 @@ #include "stylesheet.h" #include "select/hash.h" +#include "utils/utils.h" typedef struct hash_entry { const css_selector *sel; @@ -250,10 +251,15 @@ css_error css_selector_hash_find(css_selector_hash *hash, if (head->sel != NULL) { /* Search through chain for first match */ while (head != NULL) { + lwc_error lerror; bool match = false; - lwc_context_string_caseless_isequal(hash->ctx, name, - head->sel->data.name, &match); + lerror = lwc_context_string_caseless_isequal(hash->ctx, + name, head->sel->data.name, &match); + if (lerror != lwc_error_ok) + return css_error_from_lwc_error(lerror); + + if (match) break; @@ -290,11 +296,15 @@ css_error css_selector_hash_iterate(css_selector_hash *hash, /* Look for the next selector with the same element name */ for (head = head->next; head != NULL; head = head->next) { + lwc_error lerror; bool match = false; - lwc_context_string_caseless_isequal(hash->ctx, + lerror = lwc_context_string_caseless_isequal(hash->ctx, head->sel->data.name, (*current)->data.name, &match); + if (lerror != lwc_error_ok) + return css_error_from_lwc_error(lerror); + if (match) break; } -- cgit v1.2.3