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

Unified Diff: base/strings/safe_sprintf_unittest.cc

Issue 310323003: Fix SafeSPrintfTest.Truncation in base_unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/strings/safe_sprintf_unittest.cc
diff --git a/base/strings/safe_sprintf_unittest.cc b/base/strings/safe_sprintf_unittest.cc
index 937fa4eca2329342377ce1596199b62bf3b37935..d2080b530565a34d1c8c84fd33717d6eba61b6ae 100644
--- a/base/strings/safe_sprintf_unittest.cc
+++ b/base/strings/safe_sprintf_unittest.cc
@@ -4,6 +4,7 @@
#include "base/strings/safe_sprintf.h"
+#include <inttypes.h>
#include <stdio.h>
#include <string.h>
@@ -424,9 +425,9 @@ void PrintLongString(char* buf, size_t sz) {
// are all really awkward.
char ref[256];
CHECK_LE(sz, sizeof(ref));
- sprintf(ref, "A long string: %%d 00DEADBEEF %lld 0x%llX <NULL>",
+ sprintf(ref, "A long string: %%d 00DEADBEEF %lld 0x%" PRIXPTR " <NULL>",
static_cast<long long>(std::numeric_limits<intptr_t>::min()),
- (long long)PrintLongString);
+ (intptr_t)PrintLongString);
Inactive 2014/06/04 13:25:32 uintptr_t ? (http://www.nongnu.org/avr-libc/user-m
Yang Gu 2014/06/05 01:35:37 Thanks to point this out. uintptr_t is more meanin
ref[sz-1] = '\000';
#if defined(NDEBUG)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698