encoding.c: Support calling peekc past the end of the buffer. This makes calling peekc easier.

This commit is contained in:
Reece H. Dunn
2017-04-26 07:48:34 +01:00
parent 3f692f498b
commit b897ff5aa8
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -866,6 +866,10 @@ test_peekc()
assert(text_decoder_getc(decoder) == 'd');
assert(text_decoder_eof(decoder) == 1);
// Calling peekc past the end of the buffer.
assert(text_decoder_peekc(decoder) == '\0');
assert(text_decoder_eof(decoder) == 1);
destroy_text_decoder(decoder);
}