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

Fixup unix case for strerror

This commit is contained in:
William Woodall 2013-08-02 14:24:39 -07:00
parent e11abb04f2
commit c455d053bf

View File

@ -652,11 +652,11 @@ public:
explicit IOException (std::string file, int line, int errnum)
: file_(file), line_(line), errno_(errnum) {
std::stringstream ss;
char error_str [1024];
#ifdef WIN32
char error_str [1024];
strerror_s(error_str, 1024, errnum);
#else
error_str = strerror(errnum);
char * error_str = strerror(errnum);
#endif
ss << "IO Exception (" << errno_ << "): " << error_str;
ss << ", file " << file_ << ", line " << line_ << ".";