From 00764406d78eb223b41536ad011b0f31735d532c Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 3 Mar 2012 15:28:16 -0800 Subject: Fix to preserve errno across certain calls to stop printing EOVERFLOW messages in weird places --- common.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common.cpp') 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 ) -- cgit v1.2.3