diff options
-rw-r--r-- | test/test_reader_writer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index 233a3871..8bd09fe2 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -82,6 +82,10 @@ eof_test_read(void* buf, size_t size, size_t nmemb, void* stream) return 0; } + if (*count >= strlen(string)) { + return 0; + } + // Normal reading after the EOF, adjusting for the skipped index 35 *(char*)buf = string[*count - 1]; ++*count; |