From 6b3e21abf6cc65aa225e327e783d9fd0542e506c Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 29 Dec 2017 17:39:33 +0100 Subject: [PATCH] zlibut: some log messages would try to convert char* 0 to string --- src/utils/zlibut.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/utils/zlibut.cpp b/src/utils/zlibut.cpp index a5a11e64..30e694c3 100644 --- a/src/utils/zlibut.cpp +++ b/src/utils/zlibut.cpp @@ -21,6 +21,8 @@ #include "log.h" +using namespace std; + static void *allocmem( void *cp, /* The array to grow. may be NULL */ int sz, /* Unit size in bytes */ @@ -130,18 +132,19 @@ bool inflateToBuf(const void* inp, unsigned int inlen, ZLibUtBuf& buf) break; } if (err != Z_OK) { - LOGERR("Inflate: error " << err << " msg " << d_stream.msg << "\n"); + LOGERR("Inflate: error " << err << " msg " << + (d_stream.msg ? d_stream.msg : "") << endl); inflateEnd(&d_stream); return false; } } if ((err = inflateEnd(&d_stream)) != Z_OK) { - LOGERR("Inflate: inflateEnd error " << err << " msg " << d_stream.msg - << "\n"); + LOGERR("Inflate: inflateEnd error " << err << " msg " << + (d_stream.msg ? d_stream.msg : "") << endl); return false; } buf.m->datacnt = d_stream.total_out; - LOGDEB1("inflateToBuf: ok, output size " << buf.getCnt() << "\n"); + LOGDEB1("inflateToBuf: ok, output size " << buf.getCnt() << endl); return true; }