From: Frédéric Marchal Date: Wed, 6 Jan 2010 09:27:19 +0000 (+0000) Subject: Force a default value for a boolean parameter if the language file is not updated X-Git-Tag: v2_2_7~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dfc336d10ef3124446c987b97a8ae26c76d2c954;p=thirdparty%2Fsarg.git Force a default value for a boolean parameter if the language file is not updated --- diff --git a/getconf.c b/getconf.c index ea57749..9a0dfe5 100644 --- a/getconf.c +++ b/getconf.c @@ -1,6 +1,6 @@ /* * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com - * 1998, 2009 + * 1998, 2010 * SARG Squid Analysis Report Generator http://sarg.sourceforge.net * * SARG donations: @@ -159,7 +159,9 @@ static int getparam_bool(const char *param,char *buf,int *value) while (*buf && (unsigned char)*buf<=' ') buf++; *value=0; - for (str=text[144] ; *str ; str+=i) { + str=text[144]; + if (str == NULL || *str == '\0') str="yes"; + for ( ; *str ; str+=i) { for (i=0 ; str[i] && str[i]!=',' ; i++); if (strncasecmp(str,buf,i)==0) { *value=1;