summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/ConsoleBuf.hxx.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-12-05 14:55:34 (GMT)
committerBrad King <brad.king@kitware.com>2016-12-05 14:55:34 (GMT)
commit7f307d9ea6e77ee6fd7081d464314a64cbf64f32 (patch)
treea165c1c500907a74c6046dbbebcbbd68d4fda078 /Source/kwsys/ConsoleBuf.hxx.in
parentd59010e47fa953afb7f638fbab1a65195478d3fa (diff)
parent1b50bd3f5c1f608a84df89c2f5e187a53f0be31d (diff)
downloadCMake-7f307d9ea6e77ee6fd7081d464314a64cbf64f32.zip
CMake-7f307d9ea6e77ee6fd7081d464314a64cbf64f32.tar.gz
CMake-7f307d9ea6e77ee6fd7081d464314a64cbf64f32.tar.bz2
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys: KWSys 2016-12-02 (4967ccc0)
Diffstat (limited to 'Source/kwsys/ConsoleBuf.hxx.in')
-rw-r--r--Source/kwsys/ConsoleBuf.hxx.in5
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/kwsys/ConsoleBuf.hxx.in b/Source/kwsys/ConsoleBuf.hxx.in
index c45a351..cb58865 100644
--- a/Source/kwsys/ConsoleBuf.hxx.in
+++ b/Source/kwsys/ConsoleBuf.hxx.in
@@ -327,14 +327,13 @@ private:
const int length =
WideCharToMultiByte(m_activeOutputCodepage, 0, wbuffer.c_str(),
(int)wbuffer.size(), NULL, 0, NULL, NULL);
- char* buf = new char[length + 1];
+ char* buf = new char[length];
const bool success =
WideCharToMultiByte(m_activeOutputCodepage, 0, wbuffer.c_str(),
(int)wbuffer.size(), buf, length, NULL, NULL) > 0
? true
: false;
- buf[length] = '\0';
- buffer = buf;
+ buffer = std::string(buf, length);
delete[] buf;
return success;
}