fix windows consolepauser GetErrorMessage (#419)
This commit is contained in:
parent
b69f234840
commit
97cd0cb3fc
|
@ -77,13 +77,8 @@ string GetErrorMessage() {
|
||||||
NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),&result[0],result.size(),NULL);
|
NULL,GetLastError(),MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),&result[0],result.size(),NULL);
|
||||||
|
|
||||||
// Clear newlines at end of string
|
// Clear newlines at end of string
|
||||||
for(int i = result.length()-1;i >= 0;i--) {
|
while (!result.empty() && (result.back() == 0 || isspace(result.back())))
|
||||||
if(isspace(result[i])) {
|
result.pop_back();
|
||||||
result[i] = 0;
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue