From 7b16811127e5b2f5b418476f1f6b94904e1ec323 Mon Sep 17 00:00:00 2001 From: Semun Lee Date: Mon, 15 Jun 2015 17:28:20 +0900 Subject: [PATCH] Support empty appcontrol strings Change-Id: I178a907be4eb6da08511828d65bc7587385f0bea Signed-off-by: Semun Lee --- parser/pkgmgr_parser_db.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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')",\ -- 2.7.4