the zlib error print function now prints to dstream (debug.txt)

This commit is contained in:
Perttu Ahola 2011-08-08 12:11:41 +03:00
parent bdb66aced7
commit 9017c51e7f

@ -27,28 +27,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
/* report a zlib or i/o error */ /* report a zlib or i/o error */
void zerr(int ret) void zerr(int ret)
{ {
fputs("zerr: ", stderr); dstream<<"zerr: ";
switch (ret) { switch (ret) {
case Z_ERRNO: case Z_ERRNO:
if (ferror(stdin)) if (ferror(stdin))
fputs("error reading stdin\n", stderr); dstream<<"error reading stdin"<<std::endl;
if (ferror(stdout)) if (ferror(stdout))
fputs("error writing stdout\n", stderr); dstream<<"error writing stdout"<<std::endl;
break; break;
case Z_STREAM_ERROR: case Z_STREAM_ERROR:
fputs("invalid compression level\n", stderr); dstream<<"invalid compression level"<<std::endl;
break; break;
case Z_DATA_ERROR: case Z_DATA_ERROR:
fputs("invalid or incomplete deflate data\n", stderr); dstream<<"invalid or incomplete deflate data"<<std::endl;
break; break;
case Z_MEM_ERROR: case Z_MEM_ERROR:
fputs("out of memory\n", stderr); dstream<<"out of memory"<<std::endl;
break; break;
case Z_VERSION_ERROR: case Z_VERSION_ERROR:
fputs("zlib version mismatch!\n", stderr); dstream<<"zlib version mismatch!"<<std::endl;
break; break;
default: default:
dstream<<"return value = "<<ret<<"\n"; dstream<<"return value = "<<ret<<std::endl;
} }
} }