]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afsd: correct printf format mismatch in debugging printf
authorGarrett Wollman <wollman@csail.mit.edu>
Wed, 13 Aug 2014 06:20:02 +0000 (02:20 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 9 Sep 2014 12:53:29 +0000 (08:53 -0400)
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.

Reviewed-on: http://gerrit.openafs.org/11384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit f02beb8d644ec2a52bf21737a040321905a39e20)

Change-Id: I1e874f7f049e2fdfdfbe9e6413d421a5e1a5b249
Reviewed-on: http://gerrit.openafs.org/11403
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afsd/afsd.c

index 2147330d84dda4cc1d495b2f5a546022ee40241c..141dc69740d241be5939f76e640d7b5a55161929 100644 (file)
@@ -2121,7 +2121,8 @@ afsd_run(void)
     memset(inode_for_V, '\0', (cacheFiles * sizeof(AFSD_INO_T)));
     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)) {