aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/nvram/src
diff options
context:
space:
mode:
Diffstat (limited to 'package/utils/nvram/src')
-rw-r--r--package/utils/nvram/src/nvram.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/utils/nvram/src/nvram.c b/package/utils/nvram/src/nvram.c
index c4bcb1d4a6..c490597d4b 100644
--- a/package/utils/nvram/src/nvram.c
+++ b/package/utils/nvram/src/nvram.c
@@ -286,11 +286,11 @@ int nvram_commit(nvram_handle_t *h)
/* Clear data area */
ptr = (char *) header + sizeof(nvram_header_t);
- memset(ptr, 0xFF, NVRAM_SPACE - sizeof(nvram_header_t));
+ memset(ptr, 0xFF, nvram_part_size - h->offset - sizeof(nvram_header_t));
memset(&tmp, 0, sizeof(nvram_header_t));
/* Leave space for a double NUL at the end */
- end = (char *) header + NVRAM_SPACE - 2;
+ end = (char *) header + nvram_part_size - h->offset - 2;
/* Write out all tuples */
for (i = 0; i < NVRAM_ARRAYSIZE(h->nvram_hash); i++) {