From: Matthew Fernandez Date: Mon, 10 Jan 2022 00:34:27 +0000 (-0800) Subject: mapBool: take a 'const char*' parameter instead of 'char*' X-Git-Tag: 3.0.0~79^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=444391c4f08e890a2ebc49f8690f312efe16228e;p=graphviz mapBool: take a 'const char*' parameter instead of 'char*' This parameter is not modified within the function. --- 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 *);