summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-07-08 05:42:30 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-07-08 05:42:30 +0000
commitd3721674913e4be33583b30901321b4852b2134d (patch)
tree9476602a4c442575e51a1558d0ee43643a3da72d
parent240cff7d6a70e697f7b7825df60767809c2c836e (diff)
downloadmtk-20170518-d3721674913e4be33583b30901321b4852b2134d.zip
mtk-20170518-d3721674913e4be33583b30901321b4852b2134d.tar.gz
mtk-20170518-d3721674913e4be33583b30901321b4852b2134d.tar.bz2
nvram: fix displayed info about NVRAM size
Use actual partition size and content offset to calculate it. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 46260
-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 66ef904..488d641 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;
}