]> 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)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 13 Aug 2014 15:14:08 +0000 (11:14 -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.

Change-Id: Ifd124d81b16f53133293dd591f7f8cf2f7d3175a
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>
src/afsd/afsd.c

index ed5b02822f938849651f9c6e02e398cfc223cebe..0fb524a72d2b7999f49dd054ada9c64c9331dad7 100644 (file)
@@ -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)) {