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) | |||
142 | exit(1); | 142 | exit(1); |
143 | } | 143 | } |
144 | 144 | ||
145 | if (gzungetc(' ', file) != ' ') { | ||
146 | fprintf(stderr, "gzungetc error\n"); | ||
147 | exit(1); | ||
148 | } | ||
149 | |||
145 | gzgets(file, (char*)uncompr, uncomprLen); | 150 | gzgets(file, (char*)uncompr, uncomprLen); |
146 | uncomprLen = strlen((char*)uncompr); | 151 | uncomprLen = strlen((char*)uncompr); |
147 | if (uncomprLen != 6) { /* "hello!" */ | 152 | if (uncomprLen != 7) { /* " hello!" */ |
148 | fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); | 153 | fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); |
149 | exit(1); | 154 | exit(1); |
150 | } | 155 | } |
151 | if (strcmp((char*)uncompr, hello+7)) { | 156 | if (strcmp((char*)uncompr, hello+6)) { |
152 | fprintf(stderr, "bad gzgets after gzseek\n"); | 157 | fprintf(stderr, "bad gzgets after gzseek\n"); |
153 | exit(1); | 158 | exit(1); |
154 | } else { | 159 | } else { |
@@ -523,6 +528,9 @@ int main(argc, argv) | |||
523 | fprintf(stderr, "warning: different zlib version\n"); | 528 | fprintf(stderr, "warning: different zlib version\n"); |
524 | } | 529 | } |
525 | 530 | ||
531 | printf("zlib version %s = 0x%04x, compile flags = 0x%x\n", | ||
532 | ZLIB_VERSION, ZLIB_VERNUM, zlibCompileFlags()); | ||
533 | |||
526 | compr = (Byte*)calloc((uInt)comprLen, 1); | 534 | compr = (Byte*)calloc((uInt)comprLen, 1); |
527 | uncompr = (Byte*)calloc((uInt)uncomprLen, 1); | 535 | uncompr = (Byte*)calloc((uInt)uncomprLen, 1); |
528 | /* compr and uncompr are cleared to avoid reading uninitialized | 536 | /* compr and uncompr are cleared to avoid reading uninitialized |