hubbub (0.0.1-1.1) src/tokeniser/tokeniser.c

Summary

 src/tokeniser/tokeniser.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

    
download this patch

Patch contents

--- hubbub-0.0.1.orig/src/tokeniser/tokeniser.c
+++ hubbub-0.0.1/src/tokeniser/tokeniser.c
@@ -787,7 +787,7 @@
 							+ 1);
 		} else {
 			parserutils_error error;
-			const uint8_t *cptr;
+			const uint8_t *cptr = 0; //initialised to zero to avoid compiler warning
 			error = parserutils_inputstream_peek(
 					tokeniser->input,
 					tokeniser->context.pending,
@@ -1590,8 +1590,9 @@
 					tokeniser->context.match_entity.length
 					+ 1;
 		} else {
-			size_t len;
-			const uint8_t *cptr;
+			//set to 0/NULL to avoid compiler warnings
+			size_t len =0;
+			const uint8_t *cptr = NULL;
 			parserutils_error error;
 
 			error = parserutils_inputstream_peek(
@@ -3137,7 +3138,7 @@
 {
 	hubbub_token token;
 	size_t len;
-	const uint8_t *cptr;
+	const uint8_t *cptr = NULL; //set to null to avoid compiler warning
 	parserutils_error error;
 
 	/* Calling this with nothing to output is a probable bug */