Skip to content
Snippets Groups Projects
Commit 67130499 authored by rmilecki's avatar rmilecki
Browse files

nvram: fix displayed info about NVRAM size


Use actual partition size and content offset to calculate it.

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46260 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent e79d0087
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment