From 6f5c8fdfc32e8b4cdcabb8f40e1a4a5452a60282 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Fri, 19 Aug 2022 03:33:27 +0200 Subject: dmi.c: Retype variable `anchored` with bool Use the bool type instead of an integer for the variable `anchored`, since this represents its purpose much better. Signed-off-by: Felix Singer Change-Id: I5bedaf47cdd2fd5d152f69b6b02aab69fd1285c6 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66903 Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- dmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'dmi.c') diff --git a/dmi.c b/dmi.c index 7c0fc4c7..beeb10f3 100644 --- a/dmi.c +++ b/dmi.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -432,7 +433,7 @@ void dmi_init(void) */ static int dmi_compare(const char *value, const char *pattern) { - int anchored = 0; + bool anchored = false; int patternlen; msg_pspew("matching %s against %s\n", value, pattern); @@ -441,7 +442,7 @@ static int dmi_compare(const char *value, const char *pattern) return 1; if (pattern[0] == '^') { - anchored = 1; + anchored = true; pattern++; } @@ -458,7 +459,7 @@ static int dmi_compare(const char *value, const char *pattern) /* start character to make ends match */ value += valuelen - patternlen; - anchored = 1; + anchored = true; } if (anchored) -- cgit v1.2.3