aboutsummaryrefslogtreecommitdiffstats
path: root/common/stringhelp.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/stringhelp.c')
-rw-r--r--common/stringhelp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/stringhelp.c b/common/stringhelp.c
index 3424048f9..d7bb6bc37 100644
--- a/common/stringhelp.c
+++ b/common/stringhelp.c
@@ -789,6 +789,12 @@ w32_strerror (int ec)
FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, ec,
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
strerr, DIM (strerr)-1, NULL);
+ {
+ /* Strip the CR,LF - we want just the string. */
+ size_t n = strlen (strerr);
+ if (n > 2 && strerr[n-2] == '\r' && strerr[n-1] == '\n' )
+ strerr[n-2] = 0;
+ }
#endif
return strerr;
}