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>
}
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