]> Dogcows Code - chaz/tint2/blobdiff - src/util/common.c
*fix* 2 memleaks
[chaz/tint2] / src / util / common.c
index 9f122d6a3ca9b54b816851dc028b9a7e4888678d..8e213fcf8b72c5308ca93dcfc99ea9b1e6fe7cd9 100644 (file)
@@ -28,7 +28,7 @@
 
 
 #include "common.h"
-#include "server.h"
+#include "../server.h"
 
 
 
@@ -44,7 +44,9 @@ void copy_file(const char *pathSrc, const char *pathDest)
        fileDest = fopen(pathDest, "wb");
        if (fileDest == NULL) return;
 
-       while ((nb = fread(line, 1, 100, fileSrc)) > 0) fwrite(line, 1, nb, fileDest);
+       while ((nb = fread(line, 1, 100, fileSrc)) > 0)
+               if ( nb != fwrite(line, 1, nb, fileDest))
+                       printf("Error while copying file %s to %s\n", pathSrc, pathDest);
 
        fclose (fileDest);
        fclose (fileSrc);
This page took 0.023355 seconds and 4 git commands to generate.