diff options
-rwxr-xr-x | src/badge.c | 3 | ||||
-rwxr-xr-x | src/badge_internal.c | 12 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/badge.c b/src/badge.c index 1005e3f..9516d10 100755 --- a/src/badge.c +++ b/src/badge.c @@ -109,7 +109,6 @@ int badge_remove(const char *app_id) { char *caller = NULL; int result = BADGE_ERROR_NONE; - bool existing = false; if (app_id == NULL) return BADGE_ERROR_INVALID_PARAMETER; @@ -146,7 +145,6 @@ int badge_set_count(const char *app_id, unsigned int count) { char *caller = NULL; int result = BADGE_ERROR_NONE; - bool existing = false; if (app_id == NULL) return BADGE_ERROR_INVALID_PARAMETER; @@ -181,7 +179,6 @@ int badge_set_display(const char *app_id, unsigned int is_display) { char *caller = NULL; int result = BADGE_ERROR_NONE; - bool existing = false; if (app_id == NULL) return BADGE_ERROR_INVALID_PARAMETER; diff --git a/src/badge_internal.c b/src/badge_internal.c index 1b5831f..28725bb 100755 --- a/src/badge_internal.c +++ b/src/badge_internal.c @@ -312,7 +312,6 @@ int _badge_is_existing(const char *pkgname, bool *existing) { sqlite3 *db = NULL; int sqlret; - int ret = BADGE_ERROR_NONE; int result = BADGE_ERROR_NONE; if (!pkgname || !existing) { @@ -329,18 +328,19 @@ int _badge_is_existing(const char *pkgname, bool *existing) } result = _badge_check_data_inserted(pkgname, db); - if (result == BADGE_ERROR_ALREADY_EXIST) + if (result == BADGE_ERROR_ALREADY_EXIST) { *existing = TRUE; - else if (result == BADGE_ERROR_NOT_EXIST) + result = BADGE_ERROR_NONE; + } else if (result == BADGE_ERROR_NOT_EXIST) { *existing = FALSE; - else - ret = result; + result = BADGE_ERROR_NONE; + } sqlret = db_util_close(db); if (sqlret != SQLITE_OK) WARN("fail to db_util_close - [%d]", sqlret); - return BADGE_ERROR_NONE; + return result; } int _badge_foreach_existed(badge_foreach_cb callback, void *data) |