From: Michal Simek Date: Tue, 16 Apr 2019 06:27:30 +0000 (+0200) Subject: cmd: fru: Also write terminating char to arrays X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c718031b55296dd7b0b15075a1010d590df37d6b;p=thirdparty%2Fu-boot.git cmd: fru: Also write terminating char to arrays There is a need to also end up strings with terminating char \0 to be able to reread different structures. Signed-off-by: Michal Simek --- diff --git a/common/fru_ops.c b/common/fru_ops.c index 778dce23251..3c9d2804536 100644 --- a/common/fru_ops.c +++ b/common/fru_ops.c @@ -63,7 +63,7 @@ static int fru_parse_board(unsigned long addr) { u8 i, type; int len; - u8 *data; + u8 *data, *term; memcpy(&fru_data.brd.ver, (void *)addr, 6); addr += 6; @@ -89,6 +89,8 @@ static int fru_parse_board(unsigned long addr) if (!len) continue; memcpy(data, (u8 *)addr, len); + term = data + (u8)len; + *term = 0; addr += len; }