aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/nvram/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'package/utils/nvram/src/cli.c')
-rw-r--r--package/utils/nvram/src/cli.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/utils/nvram/src/cli.c b/package/utils/nvram/src/cli.c
index 66ef904885..488d641cfc 100644
--- a/package/utils/nvram/src/cli.c
+++ b/package/utils/nvram/src/cli.c
@@ -123,8 +123,8 @@ static int do_info(nvram_handle_t *nvram)
printf("NCDL values: 0x%08X\n\n", hdr->config_ncdl);
printf("%i bytes used / %i bytes available (%.2f%%)\n",
- hdr->len, NVRAM_SPACE - hdr->len,
- (100.00 / (double)NVRAM_SPACE) * (double)hdr->len);
+ hdr->len, nvram->length - nvram->offset - hdr->len,
+ (100.00 / (double)(nvram->length - nvram->offset)) * (double)hdr->len);
return 0;
}