From 0ba307f0fe94550d84499562fb8f238f770aae3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Tue, 17 May 2016 17:40:09 +0200 Subject: [PATCH] acpigen: Fix ?: operator confusion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit strlen(string) was on the "negative" side of the selection operator, the side where string is NULL. Change-Id: Ic421a5406ef788c504e30089daeba61a195457ae Reported-by: Coverity Scan (CID 1355263) Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/14867 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie --- src/arch/x86/acpigen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c index 74efbb0534..226fba153c 100644 --- a/src/arch/x86/acpigen.c +++ b/src/arch/x86/acpigen.c @@ -206,7 +206,7 @@ void acpigen_emit_stream(const char *data, int size) void acpigen_emit_string(const char *string) { - acpigen_emit_stream(string, string ? 0 : strlen(string)); + acpigen_emit_stream(string, string ? strlen(string) : 0); acpigen_emit_byte('\0'); /* NUL */ }