]> git.saurik.com Git - wxWidgets.git/commitdiff
added some error checking to wxCopyFile
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 23 Dec 2000 19:40:54 +0000 (19:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 23 Dec 2000 19:40:54 +0000 (19:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filefn.cpp

index 947c3dfff7fa4c6f4ce152321c484a82c50b58a2..c0b3ed6c1e70df3509927f0c5146133f090d973f 100644 (file)
@@ -1028,12 +1028,21 @@ wxCopyFile (const wxString& file1, const wxString& file2)
       return FALSE;
     }
 
+  // VZ: should use a buffer here! (FIXME)
+  bool ok = TRUE;
   while ((ch = getc (fd1)) != EOF)
+  {
     (void) putc (ch, fd2);
+    if ( ferror(fd2) )
+    {
+        ok = FALSE;
+        break;
+    }
+  }
 
   fclose (fd1);
   fclose (fd2);
-  return TRUE;
+  return ok;
 }
 
 bool