cmd: env: Fix CRC calculation for 'env export -c -s'

Fix failure to reimport exported checksummed, size constrained data block.

'env export -c' command ignores optional -s size argument when calculating checksum causing subsequent 'env import -c' to fail.

Signed-off-by: Neil Stainton <nstainton@asl-control.co.uk>
lime2-spi
Neil Stainton 6 years ago committed by Tom Rini
parent b592936d35
commit d71b029d1d
  1. 3
      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

Loading…
Cancel
Save