vconf: Clarify documentation for vconf_keylist_lookup() 25/200725/2
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Fri, 1 Mar 2019 11:44:08 +0000 (12:44 +0100)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 4 Mar 2019 00:21:38 +0000 (09:21 +0900)
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 <p.szewczyk@samsung.com>
vconf-compat/vconf.h

index ab9d420..89daa62 100644 (file)
@@ -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)
     {