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

Side by Side Diff: base/file_util.cc

Issue 7528: [chromium-reviews] Fix another crasher in Spell Checker related to file IO. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_util.h" 5 #include "base/file_util.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <fstream> 9 #include <fstream>
10 10
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 bool GetFileSize(const std::wstring& file_path, int64* file_size) { 289 bool GetFileSize(const std::wstring& file_path, int64* file_size) {
290 FileInfo info; 290 FileInfo info;
291 if (!GetFileInfo(file_path, &info)) 291 if (!GetFileInfo(file_path, &info))
292 return false; 292 return false;
293 *file_size = info.size; 293 *file_size = info.size;
294 return true; 294 return true;
295 } 295 }
296 296
297 bool CloseFile(FILE* file) { 297 bool CloseFile(FILE* file) {
298 if (file == NULL)
299 return true;
298 return fclose(file) == 0; 300 return fclose(file) == 0;
299 } 301 }
300 302
301 } // namespace 303 } // namespace
302 304
OLDNEW
« 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