[coreboot-gerrit] New patch to review for coreboot: acpigen: Fix ?: operator confusion
Jonathan Neuschäfer (j.neuschaefer@gmx.net)
gerrit at coreboot.org
Tue May 17 17:44:00 CEST 2016
Jonathan Neuschäfer (j.neuschaefer at gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14867
-gerrit
commit 3cf75145b24a8dd47d792e9303b91c0551df494a
Author: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Date: Tue May 17 17:40:09 2016 +0200
acpigen: Fix ?: operator confusion
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 <j.neuschaefer at gmx.net>
---
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 74efbb0..226fba1 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 */
}
More information about the coreboot-gerrit
mailing list