Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2716)

Unified Diff: base/stringprintf.cc

Issue 14749003: Stop overwriting errno in base::StringPrintf, StringAppendV, and StringToDouble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comment Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/scoped_clear_errno_unittest.cc ('k') | base/stringprintf_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/stringprintf.cc
diff --git a/base/stringprintf.cc b/base/stringprintf.cc
index 79c6562a22bf292c1f2c48e60df86a008557e3ff..814fe9955e62c4b8390bfcef509e12380e91da59 100644
--- a/base/stringprintf.cc
+++ b/base/stringprintf.cc
@@ -6,6 +6,7 @@
#include <errno.h>
+#include "base/scoped_clear_errno.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
@@ -50,7 +51,7 @@ static void StringAppendVT(StringType* dst,
GG_VA_COPY(ap_copy, ap);
#if !defined(OS_WIN)
- errno = 0;
+ ScopedClearErrno clear_errno;
#endif
int result = vsnprintfT(stack_buf, arraysize(stack_buf), format, ap_copy);
va_end(ap_copy);
« no previous file with comments | « base/scoped_clear_errno_unittest.cc ('k') | base/stringprintf_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698