summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorHorst Kronstorfer <hkronsto@frequentis.com>2011-12-16 23:33:10 +0000
committerWolfgang Denk <wd@denx.de>2011-12-19 10:19:34 +0100
commitd3f80c77ca92eaf1e7166f0c4fdcaafefc563277 (patch)
tree60eafe94864819dc8848c94074ce00b2c4942d37 /common
parenta7b39185338c333a052728a7952b5f1cba4fc22a (diff)
downloadblackbird-obmc-uboot-d3f80c77ca92eaf1e7166f0c4fdcaafefc563277.tar.gz
blackbird-obmc-uboot-d3f80c77ca92eaf1e7166f0c4fdcaafefc563277.zip
common/cmd_nvedit.c: Fix size calculation in do_env_import()
do_env_import() missed the final '\0' terminator when calculating the size of an environment data block. This led to an erroneous 'bad CRC, import failed' message for a checksum protected environment (-c.) Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_nvedit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index baaa513f6b..63afc82fe2 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -868,7 +868,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
printf("## Warning: Input data exceeds %d bytes"
" - truncated\n", MAX_ENV_SIZE);
}
- ++size;
+ size += 2;
printf("## Info: input data size = %zu = 0x%zX\n", size, size);
}
OpenPOWER on IntegriCloud