6-bit packed ascii size computation was not correctly handling strings that are not 3-byte aligned

This commit is contained in:
Duncan Laurie 2005-09-09 23:17:55 +00:00
parent a15d6a31ac
commit 6cb97e4327

View File

@ -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 */