]> git.ozlabs.org Git - ccan/blobdiff - ccan/ciniparser/ciniparser.c
tdb2: use 64 bit file offsets on 32 bit systems if available.
[ccan] / ccan / ciniparser / ciniparser.c
index d801b736eede829592734fdf4076890205406f34..2b60e409bd7ac7259d2e5245fd457e8087ed7472 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 #include <ctype.h>
-#include <ccan/ccan/ciniparser.h>
+#include <ccan/ciniparser/ciniparser.h>
 
 #define ASCIILINESZ      (1024)
 #define INI_INVALID_KEY  ((char*) NULL)
@@ -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;
@@ -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)) {