Fix to handle invalid package type input parameter as an error 07/74907/1 accepted/tizen/common/20160616.151852 accepted/tizen/ivi/20160616.105541 accepted/tizen/mobile/20160616.105455 accepted/tizen/tv/20160616.105511 accepted/tizen/wearable/20160616.105530 submit/tizen/20160616.051423
authorYunjin Lee <yunjin-.lee@samsung.com>
Thu, 16 Jun 2016 05:05:01 +0000 (14:05 +0900)
committerYunjin Lee <yunjin-.lee@samsung.com>
Thu, 16 Jun 2016 05:05:01 +0000 (14:05 +0900)
Change-Id: I99f28e2f3648b64f680c3d6bf571bd5fe4924217
Signed-off-by: Yunjin Lee <yunjin-.lee@samsung.com>
src/privilege_info.c

index 2233b01..5406c20 100755 (executable)
@@ -323,7 +323,9 @@ int privilege_info_get_display_name_by_pkgtype(const const char* package_type, c
 
        ret = privilege_info_get_display_name_string_id_by_pkgtype(package_type, api_version, privilege, &display_name_string_id);
 
-       if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) {
+       if (ret == PRVINFO_ERROR_INVALID_PARAMETER) {
+        return ret;
+    } else if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) {
                char* tempPrivilege = NULL;
                char* token = NULL;
                char* temp = NULL;
@@ -433,7 +435,9 @@ int privilege_info_get_description_by_pkgtype(const char* package_type, const ch
 
        ret = privilege_info_get_description_string_id_by_pkgtype(package_type, api_version, privilege, &description_string_id);
 
-       if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) {
+       if (ret == PRVINFO_ERROR_INVALID_PARAMETER) {
+               return ret;
+       } else if (ret == PRVINFO_ERROR_NO_MATCHING_PRIVILEGE) {
                char* temp = NULL;
                temp = dgettext("privilege", "IDS_TPLATFORM_BODY_THIS_PRIVILEGE_IS_NOT_DEFINED");
                *description = (char*)calloc(strlen(temp) + 1, sizeof(char));