fix error handling in the generic branch of wxCopyFile()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45160 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
56ba039411
commit
853c39d78b
@ -1120,18 +1120,17 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
||||
|
||||
// copy contents of file1 to file2
|
||||
char buf[4096];
|
||||
size_t count;
|
||||
for ( ;; )
|
||||
{
|
||||
count = fileIn.Read(buf, WXSIZEOF(buf));
|
||||
if ( fileIn.Error() )
|
||||
ssize_t count = fileIn.Read(buf, WXSIZEOF(buf));
|
||||
if ( count == wxInvalidOffset )
|
||||
return false;
|
||||
|
||||
// end of file?
|
||||
if ( !count )
|
||||
break;
|
||||
|
||||
if ( fileOut.Write(buf, count) < count )
|
||||
if ( fileOut.Write(buf, count) < (size_t)count )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user