Changeset: c4244249cff1 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c4244249cff1 Modified Files: common/stream/stream.c Branch: Feb2013 Log Message:
gzerror() does not return NULL in case of no error. This fixes bug 3351. diffs (31 lines): diff --git a/common/stream/stream.c b/common/stream/stream.c --- a/common/stream/stream.c +++ b/common/stream/stream.c @@ -664,11 +664,11 @@ stream_gzread(stream *s, void *buf, size { gzFile fp = (gzFile) s->stream_data.p; int size = (int) (elmsize * cnt); - int err; + int err = 0; if (!gzeof(fp)) { size = gzread(fp, buf, size); - if (gzerror(fp, &err) != NULL) { + if (gzerror(fp, &err) != NULL && err) { s->errnr = MNSTR_READ_ERROR; return -1; } @@ -682,11 +682,11 @@ stream_gzwrite(stream *s, const void *bu { gzFile fp = (gzFile) s->stream_data.p; int size = (int) (elmsize * cnt); - int err; + int err = 0; if (size) { size = gzwrite(fp, buf, size); - if (gzerror(fp, &err) != NULL) { + if (gzerror(fp, &err) != NULL && err) { s->errnr = MNSTR_WRITE_ERROR; return -1; } _______________________________________________ checkin-list mailing list checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list