提交 70252daf 编写于 作者: M Mark Adler

Add casts in gzwrite.c for pointer differences.

上级 9b703f20
......@@ -142,7 +142,8 @@
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default i/o buffer size -- double this for output when reading */
/* default i/o buffer size -- double this for output when reading (this and
twice this must be able to fit in an unsigned type) */
#define GZBUFSIZE 8192
/* gzip modes, also provide a little integrity check on the passed structure */
......
......@@ -211,7 +211,7 @@ int ZEXPORT gzwrite(file, buf, len)
if (strm->avail_in == 0)
strm->next_in = state->in;
have = strm->next_in + strm->avail_in - state->in;
have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
copy = state->size - have;
if (copy > len)
copy = len;
......@@ -273,7 +273,7 @@ int ZEXPORT gzputc(file, c)
if (state->size) {
if (strm->avail_in == 0)
strm->next_in = state->in;
have = strm->next_in + strm->avail_in - state->in;
have = (unsigned)((strm->next_in + strm->avail_in) - state->in);
if (have < state->size) {
state->in[have] = c;
strm->avail_in++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册