提交 22eb0118 编写于 作者: M Mark Adler

Have gzputc return the character written instead of the argument.

When successful, gzputc would return the second argument.  If the
second argument were -1, gzputc would return -1 instead of the
character written, which was 255.  However the -1 would not be
distinguishable from an error.  Now gzputc returns 255 in that
case.
上级 8fbd9f13
...@@ -272,14 +272,14 @@ int ZEXPORT gzputc(file, c) ...@@ -272,14 +272,14 @@ int ZEXPORT gzputc(file, c)
strm->next_in = state->in; strm->next_in = state->in;
strm->next_in[strm->avail_in++] = c; strm->next_in[strm->avail_in++] = c;
state->x.pos++; state->x.pos++;
return c; return c & 0xff;
} }
/* no room in buffer or not initialized, use gz_write() */ /* no room in buffer or not initialized, use gz_write() */
buf[0] = c; buf[0] = c;
if (gzwrite(file, buf, 1) != 1) if (gzwrite(file, buf, 1) != 1)
return -1; return -1;
return c; return c & 0xff;
} }
/* -- see zlib.h -- */ /* -- see zlib.h -- */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册