preview release: 2.6.0pre1

jw schultz jw at pegasys.ws
Sat Dec 20 09:33:50 EST 2003


On Fri, Dec 19, 2003 at 11:14:56PM +0100, Paul Slootman wrote:
> On Fri 19 Dec 2003, Wayne Davison wrote:
> 
> > Please test this and let me know if we have any remaining issues to work
> > through before the final release.  Thanks,
> 
> One tiny little nit, when compiling on alpha, I get the following
> warning:
> 
> alpha-linux-gcc -I. -I. -Wall -O2  -c sender.c -o sender.o
> sender.c: In function `read_sum_head':
> sender.c:51: warning: int format, different type arg (arg 3)
> 
> It's a size_t being printed as an int. Here's a patch:
> 
> 
> --- sender.c.orig	2003-12-19 23:08:13.000000000 +0100
> +++ sender.c	2003-12-19 23:08:21.000000000 +0100
> @@ -47,8 +47,8 @@
>  	} else {
>  		sum->s2length = read_int(f);
>  		if (sum->s2length > MD4_SUM_LENGTH) {
> -			rprintf(FERROR, "Invalid checksum length %d\n",
> -			    sum->s2length);
> +			rprintf(FERROR, "Invalid checksum length %ld\n",
> +			    (long)sum->s2length);
>  			exit_cleanup(RERR_PROTOCOL);
>  		}
>  	}
> 
> Alternatively, it could have been cast to a normal int and the format
> left as %d. However, I thought that this was the safest, as although I
> can't really see how sum->s2length could contain more than 32 bits, I
> guess it was declared as size_t for some reason...

The choice of size_t was an oversight on my part.  I should
have made it an int32 and transmitted it as a byte but by the
time i noticed it i was loath to break or complicate things.

-- 
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt



More information about the rsync mailing list