提交 5720a4cd 编写于 作者: E Emmanuel Leblond 提交者: GitHub

Merge pull request #77 from ndevilla/issue-73

Fix issue #73
......@@ -689,6 +689,7 @@ dictionary * iniparser_load(const char * ininame)
int len ;
int lineno=0 ;
int errs=0;
int mem_err=0;
dictionary * dict ;
......@@ -747,12 +748,12 @@ dictionary * iniparser_load(const char * ininame)
break ;
case LINE_SECTION:
errs = dictionary_set(dict, section, NULL);
mem_err = dictionary_set(dict, section, NULL);
break ;
case LINE_VALUE:
sprintf(tmp, "%s:%s", section, key);
errs = dictionary_set(dict, tmp, val) ;
mem_err = dictionary_set(dict, tmp, val);
break ;
case LINE_ERROR:
......@@ -768,7 +769,7 @@ dictionary * iniparser_load(const char * ininame)
}
memset(line, 0, ASCIILINESZ);
last=0;
if (errs<0) {
if (mem_err<0) {
fprintf(stderr, "iniparser: memory allocation failure\n");
break ;
}
......
#
# This dict contains an error but ends up with a correct entry
#
[section]
error is here
a = b
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册