From 30e7607b7a346695691cd819361b3c11e8d11d00 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 9 Mar 2006 14:13:55 +0000 Subject: a bunch of small cleanups based on coverity reports. Daniel * HTMLparser.c parser.c parserInternals.c pattern.c uri.c: a bunch of small cleanups based on coverity reports. Daniel --- uri.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'uri.c') diff --git a/uri.c b/uri.c index 4ac8b200..7d60ffea 100644 --- a/uri.c +++ b/uri.c @@ -1078,11 +1078,13 @@ xmlURIEscape(const xmlChar * str) static int xmlParseURIFragment(xmlURIPtr uri, const char **str) { - const char *cur = *str; - + const char *cur; + if (str == NULL) return (-1); + cur = *str; + while (IS_URIC(cur) || IS_UNWISE(cur)) NEXT(cur); if (uri != NULL) { @@ -1111,11 +1113,13 @@ xmlParseURIFragment(xmlURIPtr uri, const char **str) static int xmlParseURIQuery(xmlURIPtr uri, const char **str) { - const char *cur = *str; + const char *cur; if (str == NULL) return (-1); + cur = *str; + while ((IS_URIC(cur)) || ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur)))) NEXT(cur); -- cgit v1.2.1