From 8e34b3a8024c028dd9fd21d70525fc6d215efde5 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:22:10 -0700 Subject: zlib 1.2.0.2 --- example.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'example.c') diff --git a/example.c b/example.c index 9fd13ce..3c53a93 100644 --- a/example.c +++ b/example.c @@ -142,13 +142,18 @@ void test_gzio(out, in, uncompr, uncomprLen) exit(1); } + if (gzungetc(' ', file) != ' ') { + fprintf(stderr, "gzungetc error\n"); + exit(1); + } + gzgets(file, (char*)uncompr, uncomprLen); uncomprLen = strlen((char*)uncompr); - if (uncomprLen != 6) { /* "hello!" */ + if (uncomprLen != 7) { /* " hello!" */ fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); exit(1); } - if (strcmp((char*)uncompr, hello+7)) { + if (strcmp((char*)uncompr, hello+6)) { fprintf(stderr, "bad gzgets after gzseek\n"); exit(1); } else { @@ -523,6 +528,9 @@ int main(argc, argv) fprintf(stderr, "warning: different zlib version\n"); } + printf("zlib version %s = 0x%04x, compile flags = 0x%x\n", + ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags()); + compr = (Byte*)calloc((uInt)comprLen, 1); uncompr = (Byte*)calloc((uInt)uncomprLen, 1); /* compr and uncompr are cleared to avoid reading uninitialized -- cgit v1.2.3-55-g6feb