Eliminate magic numbers
Use sizeof() on vendor and part# rather than explicit memory length. Change-Id: I2b7e0e4a8df6448d027cc61867382f161eb990d3 Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Reviewed-on: http://review.coreboot.org/504 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
parent
9a7c246767
commit
68299ee7a4
|
@ -142,8 +142,8 @@ static void parse_mainboard(unsigned char *ptr)
|
|||
{
|
||||
struct cb_mainboard *mb = (struct cb_mainboard *)ptr;
|
||||
|
||||
strncpy(cb_info.vendor, cb_mb_vendor_part(mb), 31);
|
||||
strncpy(cb_info.part, cb_mb_part_string(mb), 31);
|
||||
strncpy(cb_info.vendor, cb_mb_vendor_part(mb), sizeof(cb_info.vendor) - 1);
|
||||
strncpy(cb_info.part, cb_mb_part_string(mb), sizeof(cb_info.part) - 1);
|
||||
}
|
||||
|
||||
static void parse_strings(unsigned char *ptr)
|
||||
|
|
Loading…
Reference in New Issue