From: Garrett Wollman Date: Wed, 13 Aug 2014 06:20:02 +0000 (-0400) Subject: afsd: correct printf format mismatch in debugging printf X-Git-Tag: upstream/1.8.0_pre1^2~619 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f02beb8d644ec2a52bf21737a040321905a39e20;p=packages%2Fo%2Fopenafs.git afsd: correct printf format mismatch in debugging printf On platforms where size_t is unsigned int, the type of cacheFiles * sizeof(AFSD_INO_T) is not an unsigned long as the format string requires. Casting cacheFiles to unsigned long ensures that the result is at least unsigned long, although it will still be wrong if any architecture makes size_t be long long. Fixes build for FreeBSD 10 on i386. Change-Id: Ifd124d81b16f53133293dd591f7f8cf2f7d3175a Reviewed-on: http://gerrit.openafs.org/11384 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Jeffrey Altman --- diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index ed5b02822..0fb524a72 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -2087,7 +2087,8 @@ afsd_run(void) } if (afsd_debug) printf("%s: %d inode_for_V entries at %p, %lu bytes\n", rn, - cacheFiles, inode_for_V, (cacheFiles * sizeof(AFSD_INO_T))); + cacheFiles, inode_for_V, + (unsigned long)cacheFiles * sizeof(AFSD_INO_T)); #endif if (!(cacheFlags & AFSCALL_INIT_MEMCACHE)) {