From 3c56608ca753799f4f86d42b93f9e96de73cdfb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Tue, 23 Jul 2019 21:00:50 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@832 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src_main/core/pibytearray.h | 2 +- src_main/core/picout.h | 2 +- src_main/core/pistring.cpp | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) 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;