From e15c8e011e4a6131e7e2745c5d75d0c3f1a5d685 Mon Sep 17 00:00:00 2001 From: "deanm@chromium.org" Date: Fri, 2 Jan 2009 12:57:53 +0000 Subject: Try to consistently use arraysize() with strlcpy(). For a char*, sizeof() == arraysize(), so there is nothing wrong with the current code. However I think it's important to be clear that the lcpy() functions work in characters and not bytes. The danger would be accidently using sizeof() with wcslcpy, for example copying some code as an example or modifying old code to use a wchar instead of a char. Review URL: http://codereview.chromium.org/17019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7536 0039d316-1c4b-4281-b951-d872f2087c98 --- base/file_util_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base/file_util_posix.cc') diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc index a05b053..3bab4d1 100644 --- a/base/file_util_posix.cc +++ b/base/file_util_posix.cc @@ -460,7 +460,7 @@ FilePath FileEnumerator::Next() { // Start a new find operation. int ftsflags = FTS_LOGICAL; char top_dir[PATH_MAX]; - base::strlcpy(top_dir, root_path_.value().c_str(), sizeof(top_dir)); + base::strlcpy(top_dir, root_path_.value().c_str(), arraysize(top_dir)); char* dir_list[2] = { top_dir, NULL }; fts_ = fts_open(dir_list, ftsflags, NULL); if (!fts_) -- cgit v1.1