From f02beb8d644ec2a52bf21737a040321905a39e20 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Wed, 13 Aug 2014 02:20:02 -0400 Subject: [PATCH] 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 --- src/afsd/afsd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) { -- 2.39.5