From 444391c4f08e890a2ebc49f8690f312efe16228e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 9 Jan 2022 16:34:27 -0800 Subject: [PATCH] mapBool: take a 'const char*' parameter instead of 'char*' This parameter is not modified within the function. --- lib/common/utils.c | 4 ++-- lib/common/utils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/common/utils.c b/lib/common/utils.c index 204c3ffe4..bad4ac1ed 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -442,9 +442,9 @@ int maptoken(char *p, char **name, int *val) return val[i]; } -bool mapBool(char *p, bool dflt) +bool mapBool(const char *p, bool dflt) { - if (!p || (*p == '\0')) + if (!p || *p == '\0') return dflt; if (!strcasecmp(p, "false")) return false; diff --git a/lib/common/utils.h b/lib/common/utils.h index a2298eff0..1aab596c2 100644 --- a/lib/common/utils.h +++ b/lib/common/utils.h @@ -88,7 +88,7 @@ UTILS_API void UF_setname(Agnode_t *, Agnode_t *); UTILS_API char *Fgets(FILE *fp); UTILS_API const char *safefile(const char *filename); -UTILS_API bool mapBool(char *, bool); +UTILS_API bool mapBool(const char*, bool); UTILS_API boolean mapbool(char *); UTILS_API int maptoken(char *, char **, int *); -- 2.50.1