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:
@@ -1120,18 +1120,17 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
|
|||||||
|
|
||||||
// copy contents of file1 to file2
|
// copy contents of file1 to file2
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
size_t count;
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
count = fileIn.Read(buf, WXSIZEOF(buf));
|
ssize_t count = fileIn.Read(buf, WXSIZEOF(buf));
|
||||||
if ( fileIn.Error() )
|
if ( count == wxInvalidOffset )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// end of file?
|
// end of file?
|
||||||
if ( !count )
|
if ( !count )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if ( fileOut.Write(buf, count) < count )
|
if ( fileOut.Write(buf, count) < (size_t)count )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user