X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/088aac85971f3f1571c7f90569c95d5025b1fd82..d5c973ccb7da1bc87c5caa5d5ac594bc217016f7:/batch.c diff --git a/batch.c b/batch.c index 237d57bd..d3f65233 100644 --- a/batch.c +++ b/batch.c @@ -264,7 +264,7 @@ int read_batch_flist_file(char *buff, int len) return bytes_read; } -unsigned char read_batch_flags() +unsigned char read_batch_flags(void) { int flags; @@ -392,20 +392,27 @@ void close_batch_csums_file(void) close(fdb); } + +/** + * Write csum info to batch file + * + * @todo This will break if s->count is ever larger than maxint. The + * batch code should probably be changed to consistently use the + * variable-length integer routines, which is probably a compatible + * change. + **/ void write_batch_csum_info(int *flist_entry, int flist_count, struct sum_struct *s) { size_t i; - unsigned int int_zero = 0; + int int_count; extern int csum_length; fdb_open = 1; - /* Write csum info to batch file */ - - /* FIXME: This will break if s->count is ever not exactly an int. */ write_batch_csums_file(flist_entry, sizeof(int)); - write_batch_csums_file(s ? &s->count : &int_zero, sizeof(int)); + int_count = s ? (int) s->count : 0; + write_batch_csums_file(&int_count, sizeof int_count); if (s) { for (i = 0; i < s->count; i++) {