Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/impl/win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/* Copyright 2012 William Woodall and John Harrison */

#include <sstream>
#include <algorithm>

#include "serial/impl/win.h"

Expand Down Expand Up @@ -366,7 +367,11 @@ Serial::SerialImpl::setPort (const string &port)
string
Serial::SerialImpl::getPort () const
{
return string(port_.begin(), port_.end());
string str(port_.length(), 0);
std::transform(port_.begin(), port_.end(), str.begin(), [] (wchar_t c) {
return (char)c;
});
return str;
}

void
Expand Down