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
This commit is contained in:
parent
240cff7d6a
commit
d372167491
1 changed files with 2 additions and 2 deletions
|
@ -123,8 +123,8 @@ static int do_info(nvram_handle_t *nvram)
|
||||||
printf("NCDL values: 0x%08X\n\n", hdr->config_ncdl);
|
printf("NCDL values: 0x%08X\n\n", hdr->config_ncdl);
|
||||||
|
|
||||||
printf("%i bytes used / %i bytes available (%.2f%%)\n",
|
printf("%i bytes used / %i bytes available (%.2f%%)\n",
|
||||||
hdr->len, NVRAM_SPACE - hdr->len,
|
hdr->len, nvram->length - nvram->offset - hdr->len,
|
||||||
(100.00 / (double)NVRAM_SPACE) * (double)hdr->len);
|
(100.00 / (double)(nvram->length - nvram->offset)) * (double)hdr->len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue