summaryrefslogtreecommitdiff
path: root/cmd/nvedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/nvedit.c')
-rw-r--r--cmd/nvedit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 793b68b887..de16c72c23 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -987,7 +987,8 @@ NXTARG: ;
}
if (chk) {
- envp->crc = crc32(0, envp->data, ENV_SIZE);
+ envp->crc = crc32(0, envp->data,
+ size ? size - offsetof(env_t, data) : ENV_SIZE);
#ifdef CONFIG_ENV_ADDR_REDUND
envp->flags = ACTIVE_FLAG;
#endif