From: Horst Kronstorfer Date: Fri, 16 Dec 2011 23:33:10 +0000 (+0000) Subject: common/cmd_nvedit.c: Fix size calculation in do_env_import() X-Git-Tag: v2011.12-rc2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3f80c77ca92eaf1e7166f0c4fdcaafefc563277;p=kernel%2Fu-boot.git 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 --- diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index baaa513..63afc82 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); }