X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fciniparser%2Fciniparser.c;h=527f83776e86428c5e283b76211291445ae7b4f9;hb=05b15e51d1312f0b2970061b6497325d43f2be02;hp=5e27a25333a0b49e72c88d0e25606ef8f4ac8e55;hpb=39357f4e89f4ac02eb11861812cbfc67b4f1d4ef;p=ccan diff --git a/ccan/ciniparser/ciniparser.c b/ccan/ciniparser/ciniparser.c index 5e27a253..527f8377 100644 --- a/ccan/ciniparser/ciniparser.c +++ b/ccan/ciniparser/ciniparser.c @@ -128,7 +128,6 @@ line_status ciniparser_line(char *input_line, char *section, strcpy(line, strstrip(input_line)); len = (int) strlen(line); - sta = LINE_UNPROCESSED; if (len < 1) { /* Empty line */ sta = LINE_EMPTY; @@ -317,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; @@ -424,12 +423,10 @@ dictionary *ciniparser_load(const char *ininame) } /* Detect multi-line */ - if (line[len] == '\\') { + if (len >= 0 && line[len] == '\\') { /* Multi-line value */ last = len; continue; - } else { - last = 0; } switch (ciniparser_line(line, section, key, val)) {