summaryrefslogtreecommitdiff
path: root/src/tokeniser/tokeniser.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-07-26 21:20:28 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-07-26 21:20:28 +0000
commit60c01918f34e99e5f9428fbc96cbcf62257c82fa (patch)
tree1c32acd13385f7d1a495654dcb2614e043bb4253 /src/tokeniser/tokeniser.c
parent9c2fbb29cc1d77e1d0600baf2d0f8bd9503ad419 (diff)
downloadlibhubbub-60c01918f34e99e5f9428fbc96cbcf62257c82fa.tar.gz
libhubbub-60c01918f34e99e5f9428fbc96cbcf62257c82fa.tar.bz2
Fix build with GCC 4.6
svn path=/trunk/hubbub/; revision=12628
Diffstat (limited to 'src/tokeniser/tokeniser.c')
-rw-r--r--src/tokeniser/tokeniser.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/tokeniser/tokeniser.c b/src/tokeniser/tokeniser.c
index 7eb6bc1..949f433 100644
--- a/src/tokeniser/tokeniser.c
+++ b/src/tokeniser/tokeniser.c
@@ -788,13 +788,16 @@ hubbub_error hubbub_tokeniser_handle_character_reference_data(
} else {
parserutils_error error;
const uint8_t *cptr = NULL;
+
error = parserutils_inputstream_peek(
tokeniser->input,
tokeniser->context.pending,
&cptr,
&len);
-
- assert(error == PARSERUTILS_OK);
+ if (error != PARSERUTILS_OK) {
+ return hubbub_error_from_parserutils_error(
+ error);
+ }
token.data.character.ptr = cptr;
token.data.character.len = len;
@@ -1586,8 +1589,10 @@ hubbub_error hubbub_tokeniser_handle_character_reference_in_attribute_value(
tokeniser->context.pending,
&cptr,
&len);
-
- assert(error == PARSERUTILS_OK);
+ if (error != PARSERUTILS_OK) {
+ return hubbub_error_from_parserutils_error(
+ error);
+ }
/* Insert the ampersand */
COLLECT_MS(attr->value, cptr, len);
@@ -3131,8 +3136,8 @@ hubbub_error emit_current_chars(hubbub_tokeniser *tokeniser)
assert(tokeniser->context.pending > 0);
error = parserutils_inputstream_peek(tokeniser->input, 0, &cptr, &len);
-
- assert(error == PARSERUTILS_OK);
+ if (error != PARSERUTILS_OK)
+ return hubbub_error_from_parserutils_error(error);
token.type = HUBBUB_TOKEN_CHARACTER;
token.data.character.ptr = cptr;