- else {
- generate_and_send_sums(fd, sx.st.st_size, f_out, f_copy);
+ else if (sx.st.st_size <= 0) {
+ write_sum_head(f_out, NULL);
+ close(fd);
+ } else {
+ if (generate_and_send_sums(fd, sx.st.st_size, f_out, f_copy) < 0) {
+ rprintf(FWARNING,
+ "WARNING: file is too large for checksum sending: %s\n",
+ fnamecmp);
+ write_sum_head(f_out, NULL);
+ }