1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 03:34:53 +08:00

Merge e5331d09fcd88d3c05bfe4cbc85701372672dd40 into 69e0372cf0d3796e84ce9a09aff1d74496f68720

This commit is contained in:
Chet Helms 2023-12-22 13:25:52 -05:00 committed by GitHub
commit 992cb1bd46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@
/* Copyright 2012 William Woodall and John Harrison */
#include <sstream>
#include <algorithm>
#include "serial/impl/win.h"
@ -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