From: Semun Lee Date: Mon, 15 Jun 2015 08:28:20 +0000 (+0900) Subject: Support empty appcontrol strings X-Git-Tag: submit/tizen/20150615.110504^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F23%2F41423%2F1;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Support empty appcontrol strings Change-Id: I178a907be4eb6da08511828d65bc7587385f0bea Signed-off-by: Semun Lee --- diff --git a/parser/pkgmgr_parser_db.c b/parser/pkgmgr_parser_db.c index 8f6c89f..d1f2d7c 100644 --- a/parser/pkgmgr_parser_db.c +++ b/parser/pkgmgr_parser_db.c @@ -979,9 +979,9 @@ static int __insert_uiapplication_appcontrol_info(manifest_x *mfx) acontrol = up->appcontrol; while (acontrol != NULL) { snprintf(buf, BUFSIZE, "%s|%s|%s",\ - acontrol->operation ? acontrol->operation : "NULL", - acontrol->uri ? acontrol->uri : "NULL", - acontrol->mime ? acontrol->mime : "NULL"); + acontrol->operation ? (strlen(acontrol->operation) > 0 ? acontrol->operation : "NULL") : "NULL", + acontrol->uri ? (strlen(acontrol->uri) > 0 ? acontrol->uri : "NULL") : "NULL", + acontrol->mime ? (strlen(acontrol->mime) > 0 ? acontrol->mime : "NULL") : "NULL"); snprintf(query, MAX_QUERY_LEN, "insert into package_app_app_control(app_id, app_control) " \ "values('%s', '%s')",\ @@ -1305,9 +1305,9 @@ static int __insert_serviceapplication_appcontrol_info(manifest_x *mfx) acontrol = sp->appcontrol; while (acontrol != NULL) { snprintf(buf, BUFSIZE, "%s|%s|%s", - acontrol->operation ? acontrol->operation : "NULL", - acontrol->uri ? acontrol->uri : "NULL", - acontrol->mime ? acontrol->mime : "NULL"); + acontrol->operation ? (strlen(acontrol->operation) > 0 ? acontrol->operation : "NULL") : "NULL", + acontrol->uri ? (strlen(acontrol->uri) > 0 ? acontrol->uri : "NULL") : "NULL", + acontrol->mime ? (strlen(acontrol->mime) > 0 ? acontrol->mime : "NULL") : "NULL"); snprintf(query, MAX_QUERY_LEN, "insert into package_app_app_control(app_id, app_control) " \ "values('%s', '%s')",\