From: erg Date: Wed, 25 Aug 2010 21:13:36 +0000 (+0000) Subject: Fix mapBool to return the default if we fall into the atoi() case but the X-Git-Tag: LAST_LIBGRAPH~32^2~1219 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49f6f1435999908535558510f4393339118a1d16;p=graphviz Fix mapBool to return the default if we fall into the atoi() case but the string does not start with a digit. --- diff --git a/lib/common/utils.c b/lib/common/utils.c index d19e4d4f9..7cfdbc37e 100644 --- a/lib/common/utils.c +++ b/lib/common/utils.c @@ -436,8 +436,10 @@ boolean mapBool(char *p, boolean dflt) return TRUE; if (!strcasecmp(p, "yes")) return TRUE; - return atoi(p); - + if (isdigit(*p)) + return atoi(p); + else + return dflt; } boolean mapbool(char *p)