From 09a180230a947e5d869323cd14e57820e967eae8 Mon Sep 17 00:00:00 2001 From: Sven Schnelle Date: Wed, 20 Jun 2012 09:22:17 +0200 Subject: =?UTF-8?q?mptable:=20Fix=20'mptable.c:1019:12:=20warning:=20?= =?UTF-8?q?=E2=80=98c=E2=80=99=20may=20be=20used=20uninitialized=20in=20th?= =?UTF-8?q?is=20function'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icf6968f5bcbbe28c3a2a1d6ee7c1fd0be583f182 Signed-off-by: Sven Schnelle Reviewed-on: http://review.coreboot.org/1110 Tested-by: build bot (Jenkins) --- util/mptable/mptable.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'util/mptable') diff --git a/util/mptable/mptable.c b/util/mptable/mptable.c index 7c3033e005..3ce249388d 100644 --- a/util/mptable/mptable.c +++ b/util/mptable/mptable.c @@ -997,9 +997,7 @@ lookupBusType( char* name ) static void busEntry( void ) { - int x; char name[ 8 ]; - char c; BusEntry entry; /* read it into local memory */ @@ -1013,12 +1011,9 @@ busEntry( void ) printf( "\t " ); pnstr( entry.busType, 6 ); printf( "\n" ); } - for ( x = 0; x < 6; ++x ) { -// if ( (c = entry.busType[ x ]) == ' ' ) - //break; - name[ x ] = c; - } - name[ x ] = '\0'; + memset(name, '\0', sizeof(name)); + strncpy(name, (char *)entry.busType, 6); + busses[ entry.busID ] = lookupBusType( name ); printf("\tsmp_write_bus(mc, %d, \"", entry.busID); pnstr( entry.busType, 6 ); -- cgit v1.2.3