summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2011-12-23 18:45:33 -0700
committerPatrick Georgi <patrick@georgi-clan.de>2012-01-07 11:50:16 +0100
commit68299ee7a44f1b43cd49a2317324eadb6616e330 (patch)
treed82f0ffaf3ce3f35d0d57b9e03ba1c43da28d5fb
parent9a7c246767cc541728108aa5c558cd08cbb5471d (diff)
downloadcoreboot-68299ee7a44f1b43cd49a2317324eadb6616e330.tar.xz
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>
-rw-r--r--payloads/coreinfo/coreboot_module.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/payloads/coreinfo/coreboot_module.c b/payloads/coreinfo/coreboot_module.c
index d33ea9ee60..77a4bb2d8b 100644
--- a/payloads/coreinfo/coreboot_module.c
+++ b/payloads/coreinfo/coreboot_module.c
@@ -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)