]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_logprint: fix shadow var in xlog_print_trans_buffer
authorEric Sandeen <sandeen@redhat.com>
Wed, 17 Oct 2018 18:25:10 +0000 (13:25 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 17 Oct 2018 18:25:10 +0000 (13:25 -0500)
xlog_print_trans_buffer takes 'i' as an argument, but then uses it later
as a local byte counter.  Give the local var more useful, non-shadow
name of "byte"

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
logprint/log_misc.c

index 99d99201e7ae0973d439f64b1e2baea27de3c308..c325f046069af178029a869642134bb519bf84fb 100644 (file)
@@ -395,15 +395,15 @@ xlog_print_trans_buffer(char **ptr, int len, int *i, int num_ops)
                if (print_data) {
                        uint *dp  = (uint *)*ptr;
                        int  nums = be32_to_cpu(head->oh_len) >> 2;
-                       int  i = 0;
+                       int  byte = 0;
 
-                       while (i < nums) {
-                               if ((i % 8) == 0)
-                                       printf("%2x ", i);
+                       while (byte < nums) {
+                               if ((byte % 8) == 0)
+                                       printf("%2x ", byte);
                                printf("%8x ", *dp);
                                dp++;
-                               i++;
-                               if ((i % 8) == 0)
+                               byte++;
+                               if ((byte % 8) == 0)
                                        printf("\n");
                        }
                        printf("\n");