aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-03 15:28:16 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-03 15:28:16 -0800
commit00764406d78eb223b41536ad011b0f31735d532c (patch)
tree93ddb8a6395b29208b73db2c60214a25745cf86d /common.cpp
parent3ead99b0883c49d465a90a6746409003d7224190 (diff)
Fix to preserve errno across certain calls to stop printing EOVERFLOW messages in weird places
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/common.cpp b/common.cpp
index 0bdb2035..38ca4d43 100644
--- a/common.cpp
+++ b/common.cpp
@@ -460,10 +460,13 @@ wcstring vformat_string(const wchar_t *format, va_list va_orig)
void append_format(wcstring &str, const wchar_t *format, ...)
{
+ /* Preserve errno across this call since it likes to stomp on it */
+ int err = errno;
va_list va;
va_start( va, format );
str.append(vformat_string(format, va));
va_end( va );
+ errno = err;
}
wchar_t *wcsvarname( const wchar_t *str )