summaryrefslogtreecommitdiffstats
path: root/src/fat_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-08-05 09:37:25 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-08-05 09:37:25 +0200
commit5a12cb2d50b1f26b3cd3df3fdf99c3160d69958b (patch)
treefa61440edea21dd318d2b285de0221e6f6df6bdd /src/fat_dir.c
parent594016c8562bdfabb8c9f4b6d82444f56b602130 (diff)
Fix some compilation warning when ncurses isn't used
Diffstat (limited to 'src/fat_dir.c')
-rw-r--r--src/fat_dir.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fat_dir.c b/src/fat_dir.c
index 6c385fd..3e4da6e 100644
--- a/src/fat_dir.c
+++ b/src/fat_dir.c
@@ -556,7 +556,15 @@ static int fat_copy(disk_t *disk_car, const partition_t *partition, dir_data_t *
{
log_error("fat_copy: Can't read cluster %u.\n", cluster);
}
- fwrite(buffer_file, 1, toread, f_out);
+ if(fwrite(buffer_file, 1, toread, f_out) != toread)
+ {
+ log_error("fat_copy: no space left on destination.\n");
+ fclose(f_out);
+ set_date(new_file, file->filestat.st_atime, file->filestat.st_mtime);
+ free(new_file);
+ free(buffer_file);
+ return -1;
+ }
file_size -= toread;
if(file_size>0)
{