diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/windows/handler/exception_handler.cc | 5 | ||||
-rw-r--r-- | src/common/windows/guid_string.cc | 12 | ||||
-rw-r--r-- | src/common/windows/http_upload.cc | 5 | ||||
-rw-r--r-- | src/common/windows/pdb_source_line_writer.cc | 13 | ||||
-rw-r--r-- | src/common/windows/string_utils-inl.h | 13 | ||||
-rw-r--r-- | src/tools/windows/symupload/symupload.cc | 6 |
6 files changed, 28 insertions, 26 deletions
diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc index 5ddb6c8f..ba14e4d2 100644 --- a/src/client/windows/handler/exception_handler.cc +++ b/src/client/windows/handler/exception_handler.cc @@ -477,7 +477,10 @@ void ExceptionHandler::UpdateNextID() { wchar_t minidump_path[MAX_PATH]; swprintf(minidump_path, MAX_PATH, L"%s\\%s.dmp", dump_path_c_, next_minidump_id_c_); - GB_WSU_SAFE_SWPRINTF_TERMINATE(minidump_path, MAX_PATH); + + // remove when VC++7.1 is no longer supported + minidump_path[MAX_PATH - 1] = L'\0'; + next_minidump_path_ = minidump_path; next_minidump_path_c_ = next_minidump_path_.c_str(); } diff --git a/src/common/windows/guid_string.cc b/src/common/windows/guid_string.cc index dcc22aa0..b7f877e6 100644 --- a/src/common/windows/guid_string.cc +++ b/src/common/windows/guid_string.cc @@ -49,8 +49,10 @@ wstring GUIDString::GUIDToWString(GUID *guid) { guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); - GB_WSU_SAFE_SWPRINTF_TERMINATE(guid_string, - sizeof(guid_string) / sizeof(guid_string[0])); + + // remove when VC++7.1 is no longer supported + guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0'; + return wstring(guid_string); } @@ -64,8 +66,10 @@ wstring GUIDString::GUIDToSymbolServerWString(GUID *guid) { guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); - GB_WSU_SAFE_SWPRINTF_TERMINATE(guid_string, - sizeof(guid_string) / sizeof(guid_string[0])); + + // remove when VC++7.1 is no longer supported + guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0'; + return wstring(guid_string); } diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index aef046ad..cac2e15a 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -230,7 +230,10 @@ wstring HTTPUpload::GenerateMultipartBoundary() { wchar_t temp[kBoundaryLength]; swprintf(temp, kBoundaryLength, L"%s%08X%08X", kBoundaryPrefix, r0, r1); - GB_WSU_SAFE_SWPRINTF_TERMINATE(temp, kBoundaryLength); + + // remove when VC++7.1 is no longer supported + temp[kBoundaryLength - 1] = L'\0'; + return wstring(temp); } diff --git a/src/common/windows/pdb_source_line_writer.cc b/src/common/windows/pdb_source_line_writer.cc index 9f4ae4b5..2fff67b0 100644 --- a/src/common/windows/pdb_source_line_writer.cc +++ b/src/common/windows/pdb_source_line_writer.cc @@ -725,8 +725,9 @@ bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) { wchar_t age_string[9]; swprintf(age_string, sizeof(age_string) / sizeof(age_string[0]), L"%x", age); - GB_WSU_SAFE_SWPRINTF_TERMINATE(age_string, - sizeof(age_string) / sizeof(age_string[0])); + + // remove when VC++7.1 is no longer supported + age_string[sizeof(age_string) / sizeof(age_string[0]) - 1] = L'\0'; info->debug_identifier = GUIDString::GUIDToSymbolServerWString(&guid); info->debug_identifier.append(age_string); @@ -742,9 +743,11 @@ bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) { swprintf(identifier_string, sizeof(identifier_string) / sizeof(identifier_string[0]), L"%08X%x", signature, age); - GB_WSU_SAFE_SWPRINTF_TERMINATE(identifier_string, - sizeof(identifier_string) / - sizeof(identifier_string[0])); + + // remove when VC++7.1 is no longer supported + identifier_string[sizeof(identifier_string) / + sizeof(identifier_string[0]) - 1] = L'\0'; + info->debug_identifier = identifier_string; } diff --git a/src/common/windows/string_utils-inl.h b/src/common/windows/string_utils-inl.h index fd7bc228..ade99792 100644 --- a/src/common/windows/string_utils-inl.h +++ b/src/common/windows/string_utils-inl.h @@ -49,19 +49,6 @@ #define WIN_STRING_FORMAT_LL "I64" #endif // MSC_VER >= 1400 -// When using swprintf, call GB_WSU_SWPRINTF_TERMINATE afterwards using the -// first two arguments to swprintf. This will ensure that the buffer is -// 0-terminated. MSVC8's swprintf always 0-terminates the buffer, so the -// macro is a no-op. This is done in a macro rather than a function -// because the function approach relies on vswprintf, which is incompatible -// with some analysis tools. -#if _MSC_VER >= 1400 // MSVC 2005/8 -#define GB_WSU_SAFE_SWPRINTF_TERMINATE(buffer, count); -#else // _MSC_VER >= 1400 -#define GB_WSU_SAFE_SWPRINTF_TERMINATE(buffer, count); \ - (buffer)[(count) - 1] = L'\0'; -#endif // _MSC_VER >= 1400 - namespace google_breakpad { using std::string; diff --git a/src/tools/windows/symupload/symupload.cc b/src/tools/windows/symupload/symupload.cc index 54abf73a..e2ec640e 100644 --- a/src/tools/windows/symupload/symupload.cc +++ b/src/tools/windows/symupload/symupload.cc @@ -97,8 +97,10 @@ static bool GetFileVersionString(const wchar_t *filename, wstring *version) { 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])); + + // remove when VC++7.1 is no longer supported + ver_string[sizeof(ver_string) / sizeof(ver_string[0]) - 1] = L'\0'; + *version = ver_string; return true; } |