From 049f38659a123edd25b01ee2004ddb3e36b6d89d Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 4 Aug 2026 10:47:56 +0200 Subject: [PATCH] util: Replace use of strcasecmp in boolstr_or_default Signed-off-by: gatecat --- common/kernel/util.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/kernel/util.h b/common/kernel/util.h index 2f7f80b1..0dc8a816 100644 --- a/common/kernel/util.h +++ b/common/kernel/util.h @@ -20,9 +20,11 @@ #ifndef UTIL_H #define UTIL_H +#include #include #include #include + #include "nextpnr.h" #include "log.h" @@ -112,13 +114,13 @@ bool boolstr_or_default(const dict &ct, const KeyType &key, b return def; if (!found->second.is_string) bool(found->second.as_int64()); - const char *str = found->second.as_string().c_str(); - if (!strcmp(str, "0") || !strcasecmp(str, "false")) + auto str = found->second.as_string(); + if (str == "0" || boost::iequals(str, "false")) return false; - else if (!strcmp(str, "1") || !strcasecmp(str, "true")) + if (str == "1" || boost::iequals(str, "true")) return true; else - log_error("Expecting bool-compatible value but got '%s'.\n", found->second.as_string().c_str()); + log_error("Expecting bool-compatible value but got '%s'.\n", str.c_str()); return false; };