vswprintf causes Purify to fail (#145). r=darin

http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/88e18d9fac4eee22


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@135 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
mmentovai 2007-03-30 20:30:08 +00:00
parent 3479e850c5
commit aec44489da
6 changed files with 42 additions and 40 deletions

View file

@ -91,13 +91,14 @@ static bool GetFileVersionString(const wchar_t *filename, wstring *version) {
wchar_t ver_string[24];
VS_FIXEDFILEINFO *file_info =
reinterpret_cast<VS_FIXEDFILEINFO*>(file_info_buffer);
WindowsStringUtils::safe_swprintf(
ver_string, sizeof(ver_string) / sizeof(ver_string[0]),
L"%d.%d.%d.%d",
file_info->dwFileVersionMS >> 16,
file_info->dwFileVersionMS & 0xffff,
file_info->dwFileVersionLS >> 16,
file_info->dwFileVersionLS & 0xffff);
swprintf(ver_string, sizeof(ver_string) / sizeof(ver_string[0]),
L"%d.%d.%d.%d",
file_info->dwFileVersionMS >> 16,
file_info->dwFileVersionMS & 0xffff,
file_info->dwFileVersionLS >> 16,
file_info->dwFileVersionLS & 0xffff);
GB_WSU_SAFE_SWPRINTF_TERMINATE(ver_string,
sizeof(ver_string) / sizeof(ver_string[0]));
*version = ver_string;
return true;
}