From 990a9a4b6b0d6b8b4b5b2ecdb0d9da921ce972a1 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Wed, 18 May 2005 07:14:15 +0000 Subject: [PATCH] fix display of binary encoded fru data --- ipmitool/lib/ipmi_fru.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipmitool/lib/ipmi_fru.c b/ipmitool/lib/ipmi_fru.c index 02324b4..0596329 100644 --- a/ipmitool/lib/ipmi_fru.c +++ b/ipmitool/lib/ipmi_fru.c @@ -103,6 +103,7 @@ get_fru_area_str(uint8_t * data, uint32_t * offset) str = malloc(size+1); if (str == NULL) return NULL; + memset(str, 0, size+1); if (len == 0) { str[0] = '\0'; @@ -112,7 +113,7 @@ get_fru_area_str(uint8_t * data, uint32_t * offset) switch (typecode) { case 0: /* Binary */ - strncpy(str, buf2str(&data[off], len), len); + strncpy(str, buf2str(&data[off], len), len*2); break; case 1: /* BCD plus */