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

Unified Diff: chrome/tools/test/image_diff/image_diff.cc

Issue 6005: Cross-platform equivalent of fopen, _wfopen_s etc.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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
Index: chrome/tools/test/image_diff/image_diff.cc
===================================================================
--- chrome/tools/test/image_diff/image_diff.cc (revision 2711)
+++ chrome/tools/test/image_diff/image_diff.cc (working copy)
@@ -13,6 +13,7 @@
#include "base/basictypes.h"
#include "base/command_line.h"
+#include "base/file_util.h"
#include "base/gfx/png_decoder.h"
#include "base/logging.h"
#include "base/process_util.h"
@@ -65,8 +66,8 @@
// Creates the image from the given filename on disk, and returns true on
// success.
bool CreateFromFilename(const char* filename) {
- FILE* f;
- if (fopen_s(&f, filename, "rb") != 0)
+ FILE* f = file_util::OpenFile(std::string(filename), "rb");
+ if (!f)
return false;
std::vector<unsigned char> compressed;
@@ -77,7 +78,7 @@
std::copy(buf, &buf[num_read], std::back_inserter(compressed));
}
- fclose(f);
+ file_util::CloseFile(f);
if (!PNGDecoder::Decode(&compressed[0], compressed.size(),
PNGDecoder::FORMAT_RGBA, &data_, &w_, &h_)) {
« chrome/browser/printing/printing_layout_uitest.cc ('K') | « chrome/tools/convert_dict/dic_reader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698