diff --git a/tests/cefclient/client_handler.cpp b/tests/cefclient/client_handler.cpp index 48fddea3b..2b3e24d0d 100644 --- a/tests/cefclient/client_handler.cpp +++ b/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; }