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

Side by Side Diff: src/processor/symbolic_constants_win.cc

Issue 1602563003: Fix usage of snprintf for MSVC (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« src/common/stdio.h ('K') | « src/processor/stackwalk_common.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 Google Inc. 1 // Copyright (c) 2015 Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 // ntstatus_reason_win.h: Windows NTSTATUS code to string. 30 // ntstatus_reason_win.h: Windows NTSTATUS code to string.
31 // 31 //
32 // Provides a means to convert NTSTATUS codes to strings. 32 // Provides a means to convert NTSTATUS codes to strings.
33 // 33 //
34 // Author: Ben Wagner 34 // Author: Ben Wagner
35 35
36 #include <cstdio>
37 #include <string> 36 #include <string>
38 37
38 #include "common/stdio.h"
39 #include "google_breakpad/common/breakpad_types.h" 39 #include "google_breakpad/common/breakpad_types.h"
40 #include "google_breakpad/common/minidump_exception_win32.h" 40 #include "google_breakpad/common/minidump_exception_win32.h"
41 #include "processor/symbolic_constants_win.h" 41 #include "processor/symbolic_constants_win.h"
42 42
43 namespace google_breakpad { 43 namespace google_breakpad {
44 44
45 std::string NTStatusToString(uint32_t ntstatus) { 45 std::string NTStatusToString(uint32_t ntstatus) {
46 std::string reason; 46 std::string reason;
47 // The content of this switch was created from ntstatus.h in the 8.1 SDK with 47 // The content of this switch was created from ntstatus.h in the 8.1 SDK with
48 // 48 //
(...skipping 6350 matching lines...) Expand 10 before | Expand all | Expand 10 after
6399 reason = "STATUS_SPACES_INTERLEAVE_LENGTH_INVALID"; 6399 reason = "STATUS_SPACES_INTERLEAVE_LENGTH_INVALID";
6400 break; 6400 break;
6401 case MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID: 6401 case MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID:
6402 reason = "STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID"; 6402 reason = "STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID";
6403 break; 6403 break;
6404 case MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES: 6404 case MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES:
6405 reason = "STATUS_SPACES_NOT_ENOUGH_DRIVES"; 6405 reason = "STATUS_SPACES_NOT_ENOUGH_DRIVES";
6406 break; 6406 break;
6407 default: { 6407 default: {
6408 char reason_string[11]; 6408 char reason_string[11];
6409 std::snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus); 6409 snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus);
6410 reason = reason_string; 6410 reason = reason_string;
6411 break; 6411 break;
6412 } 6412 }
6413 } 6413 }
6414 return reason; 6414 return reason;
6415 } 6415 }
6416 6416
6417 } // namespace google_breakpad 6417 } // namespace google_breakpad
OLDNEW
« src/common/stdio.h ('K') | « src/processor/stackwalk_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698