diff options
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 |