From 227e4cc7d70bb05536c56e9df6f268f5d79b82c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Szewczyk?= Date: Fri, 1 Mar 2019 12:44:08 +0100 Subject: [PATCH] vconf: Clarify documentation for vconf_keylist_lookup() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The returned value was not described correctly and the example ommited checking if the value was actually obtained. This commit add neccessary check to the example code for this function. Change-Id: I507e297338c4c459c99b0cbf8a0b835d71270887 Signed-off-by: Paweł Szewczyk --- vconf-compat/vconf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vconf-compat/vconf.h b/vconf-compat/vconf.h index ab9d420..89daa62 100644 --- a/vconf-compat/vconf.h +++ b/vconf-compat/vconf.h @@ -484,7 +484,7 @@ int vconf_keylist_free(keylist_t *keylist); * @param[in] keyname The key to find * @param[out] return_node The pointer of the keynode to set * - * @return The type of the found key that is vconf_t enumeration value + * @return The type of the found key that is vconf_t enumeration value or -1 on error * * @see vconf_set() * @see vconf_get() @@ -515,6 +515,11 @@ int main() return -1; } + if (r == VCONF_TYPE_NONE) { + printf("vconf key not found"); + return -1; + } + nResult = vconf_keynode_get_int(pKeyNode); if(nResult !=KEY_02_INT_VALUE) { -- 2.7.4