From ebab24f6339e0e0aaf15bc04e54e3e5541ba532a Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 16 Dec 2008 16:26:50 -0800 Subject: [PATCH] Resolve shadow conflict --- lib/libzfs/libzfs_util.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index ff90cacbd0..045fc657e9 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -509,7 +509,7 @@ void zfs_nicenum(uint64_t num, char *buf, size_t buflen) { uint64_t n = num; - int i = 0; + int i = 0, j; char u; while (n >= 1024) { @@ -537,10 +537,9 @@ zfs_nicenum(uint64_t num, char *buf, size_t buflen) * develop some complex heuristics for this, but it's much * easier just to try each combination in turn. */ - int i; - for (i = 2; i >= 0; i--) { - if (snprintf(buf, buflen, "%.*f%c", i, - (double)num / (1ULL << 10 * i), u) <= 5) + for (j = 2; j >= 0; j--) { + if (snprintf(buf, buflen, "%.*f%c", j, + (double)num / (1ULL << 10 * j), u) <= 5) break; } }