added some error checking to wxCopyFile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1028,12 +1028,21 @@ wxCopyFile (const wxString& file1, const wxString& file2)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VZ: should use a buffer here! (FIXME)
|
||||||
|
bool ok = TRUE;
|
||||||
while ((ch = getc (fd1)) != EOF)
|
while ((ch = getc (fd1)) != EOF)
|
||||||
|
{
|
||||||
(void) putc (ch, fd2);
|
(void) putc (ch, fd2);
|
||||||
|
if ( ferror(fd2) )
|
||||||
|
{
|
||||||
|
ok = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fclose (fd1);
|
fclose (fd1);
|
||||||
fclose (fd2);
|
fclose (fd2);
|
||||||
return TRUE;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Reference in New Issue
Block a user