From 6cb97e4327f6d9fb570e6d3a3089e87c49335863 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Fri, 9 Sep 2005 23:17:55 +0000 Subject: [PATCH] 6-bit packed ascii size computation was not correctly handling strings that are not 3-byte aligned --- ipmitool/lib/ipmi_fru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipmitool/lib/ipmi_fru.c b/ipmitool/lib/ipmi_fru.c index e1ab354..392945e 100644 --- a/ipmitool/lib/ipmi_fru.c +++ b/ipmitool/lib/ipmi_fru.c @@ -109,7 +109,7 @@ get_fru_area_str(uint8_t * data, uint32_t * offset) break; case 2: /* 10b: 6-bit ASCII */ /* 4 chars per group of 1-3 bytes */ - size = ((((len+2)*4)/3) & ~3); + size = (len * 8) / 6; break; case 3: /* 11b: 8-bit ASCII */ case 1: /* 01b: BCD plus */