From: DongHun Kwak Date: Tue, 27 Sep 2016 05:50:40 +0000 (+0900) Subject: Bump to iniparser 3.2 X-Git-Tag: accepted/tizen/4.0/unified/20170816.012358^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9423599d4e03a37f4badb206d6111cf2afc056c;p=platform%2Fupstream%2Finiparser.git Bump to iniparser 3.2 [Model] [BinType] AP [Customer] OPEN [Issue#] N/A [Request] N/A [Occurrence Version] N/A [Problem] Bump to iniparser 3.2 [Cause & Measure] Bump to iniparser 3.2 [Checking Method] N/A [Team] Open Source Management and Setting Part [Developer] dh0128.kwak [Solution company] Samsung [Change Type] N/A Change-Id: I81765c76d03d8ba3c557755b68234ef495ff18b5 Signed-off-by: DongHun Kwak --- diff --git a/packaging/iniparser.spec b/packaging/iniparser.spec index 25dae67..b0ed64e 100644 --- a/packaging/iniparser.spec +++ b/packaging/iniparser.spec @@ -1,5 +1,5 @@ Name: iniparser -Version: 4.0 +Version: 3.2 Release: 0 License: MIT Summary: Stand-alone ini file parsing library diff --git a/src/iniparser.c b/src/iniparser.c index b01614f..0a8e4ba 100644 --- a/src/iniparser.c +++ b/src/iniparser.c @@ -317,7 +317,7 @@ int iniparser_getsecnkeys(dictionary * d, char * s) This function returns NULL in case of error. */ /*--------------------------------------------------------------------------*/ -char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys) +char ** iniparser_getseckeys(dictionary * d, char * s) { char **keys; @@ -349,8 +349,9 @@ char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** i++; } } + free(keym); + return keys; - return (char**)keys; } /*-------------------------------------------------------------------------*/ @@ -368,17 +369,18 @@ char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** the dictionary, do not free or modify it. */ /*--------------------------------------------------------------------------*/ -char * iniparser_getstring(const dictionary * d, const char * key, const char * def) +char * iniparser_getstring(dictionary * d, const char * key, char * def) { - const char * lc_key ; + char * lc_key ; char * sval ; - char tmp_str[ASCIILINESZ+1]; if (d==NULL || key==NULL) - return (char*)def ; + return def ; - lc_key = strlwc(key, tmp_str, sizeof(tmp_str)); - sval = (char*)dictionary_get(d, lc_key, def); + lc_key = xstrdup(key); + strlwc(lc_key); + sval = dictionary_get(d, lc_key, def); + free(lc_key); return sval ; } diff --git a/src/iniparser.h b/src/iniparser.h index 11aa794..153ad07 100644 --- a/src/iniparser.h +++ b/src/iniparser.h @@ -139,8 +139,7 @@ int iniparser_getsecnkeys(dictionary * d, char * s); This function returns NULL in case of error. */ /*--------------------------------------------------------------------------*/ -char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys); - +char ** iniparser_getseckeys(dictionary * d, char * s); /*-------------------------------------------------------------------------*/ /** @@ -157,7 +156,7 @@ char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** the dictionary, do not free or modify it. */ /*--------------------------------------------------------------------------*/ -char * iniparser_getstring(const dictionary * d, const char * key, const char * def); +char * iniparser_getstring(dictionary * d, const char * key, char * def); /*-------------------------------------------------------------------------*/ /**