diff --git a/src_main/core/pibytearray.h b/src_main/core/pibytearray.h index d8047884..20396537 100755 --- a/src_main/core/pibytearray.h +++ b/src_main/core/pibytearray.h @@ -83,7 +83,7 @@ public: }; //! Return resized byte array - PIByteArray resized(int new_size) const {PIByteArray tv(*this); tv.resize(new_size); return tv;} + PIByteArray resized(int new_size) const {PIByteArray ret; ret.resize(new_size); memcpy(ret.data(), data(), new_size); return ret;} //! Convert data to Base 64 and return this byte array PIByteArray & convertToBase64(); diff --git a/src_main/core/picout.h b/src_main/core/picout.h index 631f5da7..ee260daf 100644 --- a/src_main/core/picout.h +++ b/src_main/core/picout.h @@ -35,7 +35,7 @@ #else # define piCout if (piDebug) PICout() -# define piCoutObj if (piDebug && debug()) PICout() << "" << (PIString("[") + className() + " \"" + name() + "\"]") +# define piCoutObj if (piDebug && debug()) PICout() << "" << (PIStringAscii("[") + className() + " \"" + name() + "\"]") #endif diff --git a/src_main/core/pistring.cpp b/src_main/core/pistring.cpp index e587a8b1..1da45031 100755 --- a/src_main/core/pistring.cpp +++ b/src_main/core/pistring.cpp @@ -1116,13 +1116,15 @@ PICout operator <<(PICout s, const PIString & v) { s.setControl(0, true); if (PICout::isBufferActive()) s << v.data(); - else - s << + else { #ifdef WINDOWS - (const char*)v.toByteArray().data(); + PIByteArray d = v.toByteArray(); + d.push_back(uchar('\0')); + s << (const char*)d.data(); #else - v.dataConsole(); + s << v.dataConsole(); #endif + } s.restoreControl(); s.quote(); return s;