diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:22:10 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:22:10 -0700 |
commit | 8e34b3a8024c028dd9fd21d70525fc6d215efde5 (patch) | |
tree | 896a32f54abdf42ae3c1bb3c5d5627668b481ce4 /example.c | |
parent | 13a294f044ef0a89b2dcbfbb5d4d4c792673348e (diff) |
zlib 1.2.0.2
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 |