The comma is a sequence point and i gets incremented and then used.
This results in writing past the end of the array by one (and failing
to initialize the first element as well).
Potential fix for RT ticket 131566.
Change-Id: Iabe7e78961d1f5348bca75ca5b9e6e29d8554957
Reviewed-on: http://gerrit.openafs.org/8914
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
afs_lhash_stat(lh_mem_htab, &afs_linux_lsb);
/* clear out the bucket stat vector */
- for (i = 0; i < MAX_BUCKET_LEN; i++, afs_linux_hash_bucket_dist[i] = 0);
+ for (i = 0; i < MAX_BUCKET_LEN; i++)
+ afs_linux_hash_bucket_dist[i] = 0;
cur_bucket = cur_bucket_len = 00;
/* populate the bucket stat vector */
afs_lhash_stat(lh_mem_htab, &afs_linux_lsb);
/* clear out the bucket stat vector */
- for (i = 0; i < MAX_BUCKET_LEN; i++, afs_linux_hash_bucket_dist[i] = 0);
+ for (i = 0; i < MAX_BUCKET_LEN; i++)
+ afs_linux_hash_bucket_dist[i] = 0;
cur_bucket = cur_bucket_len = 00;
/* populate the bucket stat vector */