summaryrefslogtreecommitdiff
path: root/gzwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzwrite.c')
-rw-r--r--gzwrite.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gzwrite.c b/gzwrite.c
index 50b1a7c..844312a 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -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 */