diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-07-08 05:45:09 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-07-08 05:45:09 +0000 |
commit | b84a8b054325d66e75fca15ff4f88417e690fa13 (patch) | |
tree | a94c935d24dd633c3caeabd0da9052a7c5d6146f /package/utils/nvram | |
parent | 716f2956e1d200ef93534bccfc47bb4280d688a5 (diff) | |
download | upstream-b84a8b054325d66e75fca15ff4f88417e690fa13.tar.gz upstream-b84a8b054325d66e75fca15ff4f88417e690fa13.tar.bz2 upstream-b84a8b054325d66e75fca15ff4f88417e690fa13.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>
Backport of r46260
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@46261 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/utils/nvram')
-rw-r--r-- | package/utils/nvram/src/cli.c | 4 |
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; } |