diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/eina/src/lib/eina_simple_xml_parser.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libraries/eina/src/lib/eina_simple_xml_parser.c b/libraries/eina/src/lib/eina_simple_xml_parser.c index 08a8259..4e357ba 100644 --- a/libraries/eina/src/lib/eina_simple_xml_parser.c +++ b/libraries/eina/src/lib/eina_simple_xml_parser.c | |||
@@ -38,7 +38,10 @@ extern "C" | |||
38 | void *alloca (size_t); | 38 | void *alloca (size_t); |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #include <strings.h> | 41 | #ifdef HAVE_STRINGS_H |
42 | # include <strings.h> | ||
43 | #endif | ||
44 | #include <stdlib.h> | ||
42 | #include <string.h> | 45 | #include <string.h> |
43 | #include <ctype.h> | 46 | #include <ctype.h> |
44 | 47 | ||
@@ -121,7 +124,7 @@ static inline const char * | |||
121 | _eina_simple_xml_whitespace_find(const char *itr, const char *itr_end) | 124 | _eina_simple_xml_whitespace_find(const char *itr, const char *itr_end) |
122 | { | 125 | { |
123 | for (; itr < itr_end; itr++) | 126 | for (; itr < itr_end; itr++) |
124 | if (isspace(*itr)) break; | 127 | if (isspace((unsigned char)*itr)) break; |
125 | return itr; | 128 | return itr; |
126 | } | 129 | } |
127 | 130 | ||
@@ -129,7 +132,7 @@ static inline const char * | |||
129 | _eina_simple_xml_whitespace_skip(const char *itr, const char *itr_end) | 132 | _eina_simple_xml_whitespace_skip(const char *itr, const char *itr_end) |
130 | { | 133 | { |
131 | for (; itr < itr_end; itr++) | 134 | for (; itr < itr_end; itr++) |
132 | if (!isspace(*itr)) break; | 135 | if (!isspace((unsigned char)*itr)) break; |
133 | return itr; | 136 | return itr; |
134 | } | 137 | } |
135 | 138 | ||
@@ -137,7 +140,7 @@ static inline const char * | |||
137 | _eina_simple_xml_whitespace_unskip(const char *itr, const char *itr_start) | 140 | _eina_simple_xml_whitespace_unskip(const char *itr, const char *itr_start) |
138 | { | 141 | { |
139 | for (itr--; itr > itr_start; itr--) | 142 | for (itr--; itr > itr_start; itr--) |
140 | if (!isspace(*itr)) break; | 143 | if (!isspace((unsigned char)*itr)) break; |
141 | return itr + 1; | 144 | return itr + 1; |
142 | } | 145 | } |
143 | 146 | ||
@@ -309,7 +312,7 @@ eina_simple_xml_parse(const char *buf, unsigned buflen, Eina_Bool strip, Eina_Si | |||
309 | (!memcmp(itr + 2, "DOCTYPE", | 312 | (!memcmp(itr + 2, "DOCTYPE", |
310 | sizeof("DOCTYPE") - 1)) && | 313 | sizeof("DOCTYPE") - 1)) && |
311 | ((itr[2 + sizeof("DOCTYPE") - 1] == '>') || | 314 | ((itr[2 + sizeof("DOCTYPE") - 1] == '>') || |
312 | (isspace(itr[2 + sizeof("DOCTYPE") - 1])))) | 315 | (isspace((unsigned char)itr[2 + sizeof("DOCTYPE") - 1])))) |
313 | { | 316 | { |
314 | type = EINA_SIMPLE_XML_DOCTYPE; | 317 | type = EINA_SIMPLE_XML_DOCTYPE; |
315 | toff = sizeof("!DOCTYPE") - 1; | 318 | toff = sizeof("!DOCTYPE") - 1; |
@@ -455,7 +458,7 @@ eina_simple_xml_tag_attributes_find(const char *buf, unsigned buflen) | |||
455 | 458 | ||
456 | for (; itr < itr_end; itr++) | 459 | for (; itr < itr_end; itr++) |
457 | { | 460 | { |
458 | if (!isspace(*itr)) | 461 | if (!isspace((unsigned char)*itr)) |
459 | { | 462 | { |
460 | /* user skip tagname and already gave it the attributes */ | 463 | /* user skip tagname and already gave it the attributes */ |
461 | if (*itr == '=') | 464 | if (*itr == '=') |
@@ -492,7 +495,7 @@ eina_simple_xml_attributes_parse(const char *buf, unsigned buflen, Eina_Simple_X | |||
492 | 495 | ||
493 | key = p; | 496 | key = p; |
494 | for (key_end = key; key_end < itr_end; key_end++) | 497 | for (key_end = key; key_end < itr_end; key_end++) |
495 | if ((*key_end == '=') || (isspace(*key_end))) break; | 498 | if ((*key_end == '=') || (isspace((unsigned char)*key_end))) break; |
496 | if (key_end == itr_end) return EINA_FALSE; | 499 | if (key_end == itr_end) return EINA_FALSE; |
497 | if (key_end == key) continue; | 500 | if (key_end == key) continue; |
498 | 501 | ||
@@ -504,7 +507,7 @@ eina_simple_xml_attributes_parse(const char *buf, unsigned buflen, Eina_Simple_X | |||
504 | value++; | 507 | value++; |
505 | } | 508 | } |
506 | for (; value < itr_end; value++) | 509 | for (; value < itr_end; value++) |
507 | if (!isspace(*value)) break; | 510 | if (!isspace((unsigned char)*value)) break; |
508 | if (value == itr_end) return EINA_FALSE; | 511 | if (value == itr_end) return EINA_FALSE; |
509 | 512 | ||
510 | if ((*value == '"') || (*value == '\'')) | 513 | if ((*value == '"') || (*value == '\'')) |