From ddf54b1c8b2ef6e8e3d2a673e0dd1ab43c7edc2c Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 27 Jul 2014 11:02:15 +0200 Subject: util/sconfig: fix check for count of command line arguments Valid invocations are when -s|b|k outputfile is missing (argc == 3) and when it is followed by the file name (argc == 5); it's an error when "outputfile" is missing (argc == 4) or when there are more arguments than expected (argc > 5). Fixes "Uninitialized argument value" error found by scan-build from clang version 3.2-11. Change-Id: I8c489863323eb60cbaa5e82a80f5d78a6ca893c2 Signed-off-by: Daniele Forsi Reviewed-on: http://review.coreboot.org/6378 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi Reviewed-by: Edward O'Callaghan --- util/sconfig/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/sconfig') diff --git a/util/sconfig/main.c b/util/sconfig/main.c index 74193e6740..f6ec0e200b 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -557,7 +557,7 @@ static void usage(void) int main(int argc, char** argv) { - if (argc < 3) + if (argc != 3 && argc != 5) usage(); char *mainboard=argv[1]; -- cgit v1.2.3