From: Martin Pool Date: Tue, 9 Apr 2002 06:11:06 +0000 (+0000) Subject: long int and signedness fix from Nelson Beebe X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/e35080cede02c640ac482debfc40d8b2de4bb58e long int and signedness fix from Nelson Beebe --- diff --git a/match.c b/match.c index 292c537e..37ba1a0c 100644 --- a/match.c +++ b/match.c @@ -153,9 +153,12 @@ static void hash_search(int f,struct sum_struct *s, last_i = -1; if (verbose > 2) - rprintf(FINFO,"hash search b=%d len=%.0f\n",s->n,(double)len); + rprintf(FINFO,"hash search b=%ld len=%.0f\n", + (long) s->n, (double)len); - k = MIN(len, s->n); + /* cast is to make s->n signed; it should always be reasonably + * small */ + k = MIN(len, (OFF_T) s->n); map = (schar *)map_ptr(buf,0,k); @@ -170,8 +173,8 @@ static void hash_search(int f,struct sum_struct *s, end = len + 1 - s->sums[s->count-1].len; if (verbose > 3) - rprintf(FINFO,"hash search s->n=%d len=%.0f count=%d\n", - s->n,(double)len,s->count); + rprintf(FINFO, "hash search s->n=%ld len=%.0f count=%ld\n", + (long) s->n, (double) len, (long) s->count); do { tag t = gettag2(s1,s2); diff --git a/tls.c b/tls.c index 98116871..0c310e4a 100644 --- a/tls.c +++ b/tls.c @@ -115,9 +115,9 @@ static void list_file (const char *fname) /* NB: need to pass size as a double because it might be be * too large for a long. */ - printf("%s %12.0f %6d.%-6d %6d %s %s%s\n", + printf("%s %12.0f %6ld.%-6ld %6d %s %s%s\n", permbuf, (double) buf.st_size, - buf.st_uid, buf.st_gid, + (long) buf.st_uid, (long) buf.st_gid, buf.st_nlink, datebuf, fname, linkbuf); }