| Index: base/file_util_win.cc
|
| ===================================================================
|
| --- base/file_util_win.cc (revision 48256)
|
| +++ base/file_util_win.cc (working copy)
|
| @@ -647,15 +647,11 @@
|
| if (file == INVALID_HANDLE_VALUE)
|
| return -1;
|
|
|
| - int ret_value;
|
| DWORD read;
|
| - if (::ReadFile(file, data, size, &read, NULL) && read == size) {
|
| - ret_value = static_cast<int>(read);
|
| - } else {
|
| - ret_value = -1;
|
| - }
|
| -
|
| - return ret_value;
|
| + if (::ReadFile(file, data, size, &read, NULL) &&
|
| + static_cast<int>(read) == size)
|
| + return read;
|
| + return -1;
|
| }
|
|
|
| int WriteFile(const FilePath& filename, const char* data, int size) {
|
| @@ -675,8 +671,8 @@
|
|
|
| DWORD written;
|
| BOOL result = ::WriteFile(file, data, size, &written, NULL);
|
| - if (result && written == size)
|
| - return static_cast<int>(written);
|
| + if (result && static_cast<int>(written) == size)
|
| + return written;
|
|
|
| if (!result) {
|
| // WriteFile failed.
|
|
|