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

Unified Diff: net/disk_cache/mapped_file_unittest.cc

Issue 17019: Try to consistently use arraysize() with strlcpy(). (Closed)
Patch Set: Created 12 years 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 | « net/disk_cache/entry_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/mapped_file_unittest.cc
diff --git a/net/disk_cache/mapped_file_unittest.cc b/net/disk_cache/mapped_file_unittest.cc
index 28eeff5e5865f2681aa00f8f5beeb862d25e1cf4..a9b3754d2ec17798810a969d887c1ee0f137eff8 100644
--- a/net/disk_cache/mapped_file_unittest.cc
+++ b/net/disk_cache/mapped_file_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/string_util.h"
#include "net/disk_cache/disk_cache_test_base.h"
@@ -77,7 +78,7 @@ TEST_F(DiskCacheTest, MappedFile_SyncIO) {
char buffer1[20];
char buffer2[20];
CacheTestFillBuffer(buffer1, sizeof(buffer1), false);
- base::strlcpy(buffer1, "the data", sizeof(buffer1));
+ base::strlcpy(buffer1, "the data", arraysize(buffer1));
EXPECT_TRUE(file->Write(buffer1, sizeof(buffer1), 8192));
EXPECT_TRUE(file->Read(buffer2, sizeof(buffer2), 8192));
EXPECT_STREQ(buffer1, buffer2);
@@ -100,7 +101,7 @@ TEST_F(DiskCacheTest, MappedFile_AsyncIO) {
char buffer1[20];
char buffer2[20];
CacheTestFillBuffer(buffer1, sizeof(buffer1), false);
- base::strlcpy(buffer1, "the data", sizeof(buffer1));
+ base::strlcpy(buffer1, "the data", arraysize(buffer1));
bool completed;
EXPECT_TRUE(file->Write(buffer1, sizeof(buffer1), 1024 * 1024, &callback,
&completed));
« no previous file with comments | « net/disk_cache/entry_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698