aboutsummaryrefslogtreecommitdiffstats
path: root/package
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
commit1a4ef91075566b25647b7849f440d736d457f15b (patch)
tree299319e7761499bcae62bcf81dc6c9d8e37f3400 /package
parentb589f3290d25f11346553d041a5b0fda5e6e2ab2 (diff)
downloadmaster-187ad058-1a4ef91075566b25647b7849f440d736d457f15b.tar.gz
master-187ad058-1a4ef91075566b25647b7849f440d736d457f15b.tar.bz2
master-187ad058-1a4ef91075566b25647b7849f440d736d457f15b.zip
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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46260 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-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;
}