X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fciniparser%2Fciniparser.c;h=527f83776e86428c5e283b76211291445ae7b4f9;hb=fe328d06ed6df8d5a92eaab4be2d645affeeb99e;hp=d28c15817e10de530ef43e05744d56106ae0fef9;hpb=edede43eef40cc154054d643eccd2b987b03e4b1;p=ccan diff --git a/ccan/ciniparser/ciniparser.c b/ccan/ciniparser/ciniparser.c index d28c1581..527f8377 100644 --- a/ccan/ciniparser/ciniparser.c +++ b/ccan/ciniparser/ciniparser.c @@ -316,7 +316,7 @@ int ciniparser_getint(dictionary *d, const char *key, int notfound) return (int) strtol(str, NULL, 10); } -double ciniparser_getdouble(dictionary *d, char *key, double notfound) +double ciniparser_getdouble(dictionary *d, const char *key, double notfound) { char *str; @@ -423,7 +423,7 @@ dictionary *ciniparser_load(const char *ininame) } /* Detect multi-line */ - if (line[len] == '\\') { + if (len >= 0 && line[len] == '\\') { /* Multi-line value */ last = len; continue;