Mercurial > code
changeset 76:4c5f69f5f409
Merge for inifile
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 14 Nov 2011 18:51:07 +0100 |
parents | 37fa222d7cc6 |
children | e48757f916ae |
files | inifile.c |
diffstat | 1 files changed, 2 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/inifile.c Mon Nov 14 15:00:11 2011 +0100 +++ b/inifile.c Mon Nov 14 18:51:07 2011 +0100 @@ -290,8 +290,6 @@ static void * inifile_read(struct inifile *file, FILE *fp) { - int status; - while (inifile_getline(file, fp) == 0) { if (inifile_readline(file) == NULL) return inifile_fatal(file, fp, "%s", strerror(errno)); @@ -453,7 +451,7 @@ { char *assignKey, *endKey, *endValue, token = '\0'; int length = 0; - struct option *option, tmp = { NULL }; + struct option *option, tmp; /* No '=' found */ if ((assignKey = strchr(*lp, '=')) == NULL) { @@ -473,6 +471,7 @@ return 0; } + memset(&tmp, 0, sizeof (struct option)); if ((tmp.key = xstrndup(*lp, endKey - *lp)) == NULL) return -1;