From 1544c6020c2e354af718bbe5f8120e1fe2970a86 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 17 Jan 2013 22:26:26 +0000 Subject: [PATCH] Merge revision 1017 changes: - Linux: Fix compile error due to fwrite() and warn_unused_result. git-svn-id: https://chromiumembedded.googlecode.com/svn/branches/1364@1018 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- cef3/tests/cefclient/client_handler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cef3/tests/cefclient/client_handler.cpp b/cef3/tests/cefclient/client_handler.cpp index 48fddea3b..2b3e24d0d 100644 --- a/cef3/tests/cefclient/client_handler.cpp +++ b/cef3/tests/cefclient/client_handler.cpp @@ -636,7 +636,13 @@ bool ClientHandler::Save(const std::string& path, const std::string& data) { FILE* f = fopen(path.c_str(), "w"); if (!f) return false; - fwrite(data.c_str(), data.size(), 1, f); + size_t total = 0; + do { + size_t write = fwrite(data.c_str() + total, 1, data.size() - total, f); + if (write == 0) + break; + total += write; + } while (total < data.size()); fclose(f); return true; }