diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:26 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:26 -0700 |
commit | 7751bd4c715ea8478113e34b49b5a794a4642e8e (patch) | |
tree | 537ba82b3780f933c2f17028febd6fe3a2332190 /gzwrite.c | |
parent | e0ff940e1adb68d3575705ebf1546d9f07ad3b4a (diff) | |
download | zlib-7751bd4c715ea8478113e34b49b5a794a4642e8e.tar.gz zlib-7751bd4c715ea8478113e34b49b5a794a4642e8e.tar.bz2 zlib-7751bd4c715ea8478113e34b49b5a794a4642e8e.zip |
zlib 1.2.3.9v1.2.3.9
Diffstat (limited to 'gzwrite.c')
-rw-r--r-- | gzwrite.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -3,8 +3,6 @@ | |||
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef OLD_GZIO | ||
7 | |||
8 | #include "gzguts.h" | 6 | #include "gzguts.h" |
9 | 7 | ||
10 | /* Local functions */ | 8 | /* Local functions */ |
@@ -77,7 +75,7 @@ local int gz_comp(state, flush) | |||
77 | doing Z_FINISH then don't write until we get to Z_STREAM_END */ | 75 | doing Z_FINISH then don't write until we get to Z_STREAM_END */ |
78 | if (strm->avail_out == 0 || (flush != Z_NO_FLUSH && | 76 | if (strm->avail_out == 0 || (flush != Z_NO_FLUSH && |
79 | (flush != Z_FINISH || ret == Z_STREAM_END))) { | 77 | (flush != Z_FINISH || ret == Z_STREAM_END))) { |
80 | have = strm->next_out - state->next; | 78 | have = (unsigned)(strm->next_out - state->next); |
81 | if (have && ((got = write(state->fd, state->next, have)) < 0 || | 79 | if (have && ((got = write(state->fd, state->next, have)) < 0 || |
82 | (unsigned)got != have)) { | 80 | (unsigned)got != have)) { |
83 | gz_error(state, Z_ERRNO, zstrerror()); | 81 | gz_error(state, Z_ERRNO, zstrerror()); |
@@ -271,7 +269,7 @@ int ZEXPORT gzputs(file, str) | |||
271 | unsigned len; | 269 | unsigned len; |
272 | 270 | ||
273 | /* write string */ | 271 | /* write string */ |
274 | len = strlen(str); | 272 | len = (unsigned)strlen(str); |
275 | ret = gzwrite(file, str, len); | 273 | ret = gzwrite(file, str, len); |
276 | return ret == 0 && len != 0 ? -1 : ret; | 274 | return ret == 0 && len != 0 ? -1 : ret; |
277 | } | 275 | } |
@@ -530,5 +528,3 @@ int ZEXPORT gzclose_w(file) | |||
530 | free(state); | 528 | free(state); |
531 | return ret ? Z_ERRNO : Z_OK; | 529 | return ret ? Z_ERRNO : Z_OK; |
532 | } | 530 | } |
533 | |||
534 | #endif /* !OLD_GZIO */ | ||