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

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: Remove inttypes.h 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..61333e618fdf4f3ba9cc0679e9fd8d0640d17326 100644
--- a/base/strings/safe_sprintf_unittest.cc
+++ b/base/strings/safe_sprintf_unittest.cc
@@ -426,7 +426,7 @@ void PrintLongString(char* buf, size_t sz) {
CHECK_LE(sz, sizeof(ref));
sprintf(ref, "A long string: %%d 00DEADBEEF %lld 0x%llX <NULL>",
static_cast<long long>(std::numeric_limits<intptr_t>::min()),
Mark Mentovai 2014/06/16 16:38:46 When I mentioned using PRIdPTR, I was talking abou
- (long long)PrintLongString);
+ (unsigned long long)(uintptr_t)PrintLongString);
Mark Mentovai 2014/06/16 16:38:46 1. What’s with the double cast now? 2. Don’t use
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