From: Simon Wilkinson Date: Sat, 31 Mar 2012 15:59:16 +0000 (-0400) Subject: vos: Initialise total counters X-Git-Tag: openafs-stable-1_8_0pre1~2597 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=20265ddd78dbe4a7777b17912f2c3f00dbf2a1db vos: Initialise total counters When VolumeStats_int calls DisplayFormat, it isn't interested in the total counters it provides. So, it doesn't both initialising the variables it passes in to hold these counters - garbage in, garbage out. However, this shows up as an uninitialises variable warning, so set them all to 0 to keep clang happy. Caught by clang-analyzer Change-Id: Ia3e1eadde6eac6fa924a4ff9ad566c5c50f9ff40 Reviewed-on: http://gerrit.openafs.org/7095 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/volser/vos.c b/src/volser/vos.c index d09ec8e..a4459e5 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -1474,7 +1474,9 @@ static void VolumeStats_int(volintInfo *pntr, struct nvldbentry *entry, afs_uint32 server, afs_int32 part, int voltype) { - int totalOK, totalNotOK, totalBusy; + int totalOK = 0; + int totalNotOK = 0; + int totalBusy = 0; DisplayFormat(pntr, server, part, &totalOK, &totalNotOK, &totalBusy, 0, 1, 1);