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 <felixsinger@posteo.net>
Change-Id: I5bedaf47cdd2fd5d152f69b6b02aab69fd1285c6
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/66903
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71490
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/dmi.c b/dmi.c
index 9dc29e0..716b417 100644
--- a/dmi.c
+++ b/dmi.c
@@ -27,6 +27,7 @@
#include <strings.h>
#include <string.h>
#include <ctype.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -427,7 +428,7 @@
*/
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);
@@ -436,7 +437,7 @@
return 1;
if (pattern[0] == '^') {
- anchored = 1;
+ anchored = true;
pattern++;
}
@@ -453,7 +454,7 @@
/* start character to make ends match */
value += valuelen - patternlen;
- anchored = 1;
+ anchored = true;
}
if (anchored)