From 29789d8106fb3beb6626be614d7c8819d4f561a7 Mon Sep 17 00:00:00 2001 From: mmentovai Date: Mon, 9 Apr 2007 18:35:20 +0000 Subject: Wrong version of swprintf used with VS 2003/7.1 CRT. r=bryner http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/eadfa703d4bd8a4a git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@143 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/windows/string_utils-inl.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/common') diff --git a/src/common/windows/string_utils-inl.h b/src/common/windows/string_utils-inl.h index ade99792..db18124d 100644 --- a/src/common/windows/string_utils-inl.h +++ b/src/common/windows/string_utils-inl.h @@ -49,6 +49,15 @@ #define WIN_STRING_FORMAT_LL "I64" #endif // MSC_VER >= 1400 +// A nonconforming version of swprintf, without the length argument, was +// included with the CRT prior to MSVC8. Although a conforming version was +// also available via an overload, it is not reliably chosen. _snwprintf +// behaves as a standards-confirming swprintf should, so force the use of +// _snwprintf when using older CRTs. +#if _MSC_VER < 1400 // MSVC 2005/8 +#define swprintf _snwprintf +#endif // MSC_VER < 1400 + namespace google_breakpad { using std::string; -- cgit v1.2.1