while (bytes_left > 0) {
size_t bufsize = (bytes_left > BLOCKSIZE) ? BLOCKSIZE : bytes_left;
- size_t bytes_read;
+ ssize_t bytes_read;
char *blkbuf = buffer_block (wbuf);
if ((bytes_read = full_read (fd, blkbuf, bufsize)) < 0) {
time_t ctime = fs.st_mtime;
struct sp_array *ma = sparray_new();
- if (sparse) {
+ if (sparse && !S_ISBLK(fs.st_mode)) {
if (!scan_sparse_file (fd, ma)) {
fprintf (stderr, "scanning '%s' failed\n", source);
exit (-1);