X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=options.c;fp=options.c;h=84f08ca64152564978f04c6821751835602f10d6;hb=515b441b0478ac01f1c5dfef3810a7778f899c9c;hp=28aaf7c1268de317c0fd4b8df83d2c8e872a7b5e;hpb=6a182e3e9a932830341308eb5fb58eb92f5c3682;p=pkg%2Fabook.git diff --git a/options.c b/options.c index 28aaf7c..84f08ca 100644 --- a/options.c +++ b/options.c @@ -279,11 +279,12 @@ opt_set_set_option(char *p, struct option *opt) { int len; - strtrim(p); + assert(p); + strtrim(p); len = strlen(p); - if(p[len - 1] == '\"' && *p == '\"') { + if(*p == '\"' && p[len - 1] == '\"') { if(len < 3) return _("invalid value"); p[len - 1] = 0; @@ -318,6 +319,9 @@ opt_set_option(char *var, char *p) { int i; + assert(var); + assert(p); + for(i = 0; abook_vars[i].option; i++) if(!strcmp(abook_vars[i].option, var)) return opt_set_set_option(p, &abook_vars[i]);