mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-13 10:42:58 +01:00
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
This commit is contained in:
parent
095ffd023f
commit
1544c6020c
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user