2
0
mirror of https://github.com/boostorg/nowide.git synced 2026-02-22 15:32:35 +00:00

Merge pull request #3 from MikaelSmith/fix-older-windows

Fix iostream output on older Windows
This commit is contained in:
Artyom Beilis
2015-12-07 20:43:41 +02:00

View File

@@ -64,8 +64,8 @@ namespace details {
namespace uf = boost::locale::utf;
char const *b = p;
char const *e = p+n;
DWORD size=0;
if(!isatty_) {
DWORD size=0;
if(!WriteFile(handle_,p,n,&size,0) || static_cast<int>(size) != n)
return -1;
return n;
@@ -81,7 +81,7 @@ namespace details {
}
if(c==uf::illegal)
return -1;
if(!WriteConsoleW(handle_,wbuffer_,out - wbuffer_,0,0))
if(!WriteConsoleW(handle_,wbuffer_,out - wbuffer_,&size,0))
return -1;
return decoded;
}