Fixes a bug in check when detecting garbage data over the expected end of a file.

More extensive tests to detect the append/truncate conditions.
This commit is contained in:
Andrea Mazzoleni 2011-04-28 21:38:25 +02:00
parent 5baef32fb9
commit a9255683f4
8 changed files with 204 additions and 42 deletions

View file

@ -164,6 +164,12 @@ int handle_create(struct snapraid_handle* handle, struct snapraid_file* file)
}
#endif
/* return the warning condition of a larger file */
if (handle->st.st_size > file->size) {
fprintf(stderr, "File '%s' truncated to size %llu.\n", handle->path, file->size);
return 1;
}
return 0;
}