diff options
author | seungha.son <seungha.son@samsung.com> | 2017-03-23 09:49:29 +0900 |
---|---|---|
committer | Son seungha <seungha.son@samsung.com> | 2017-03-22 23:10:12 -0700 |
commit | fae09ffb35b8dce0efc5b41e03eb77be4e72cb20 (patch) | |
tree | b2519b78d99d8e3b07b09fe3dd525e3391805ff8 | |
parent | 12901a7b4fa0936d70f99a7cd5891987ae268c64 (diff) | |
download | notification-fae09ffb35b8dce0efc5b41e03eb77be4e72cb20.tar.gz notification-fae09ffb35b8dce0efc5b41e03eb77be4e72cb20.tar.bz2 notification-fae09ffb35b8dce0efc5b41e03eb77be4e72cb20.zip |
Fix wrong statement condition
Signed-off-by: seungha.son <seungha.son@samsung.com>
Change-Id: I9c73e8d3a4b20c588217bf5692893f6179e890ba
-rwxr-xr-x | src/notification.c | 22 | ||||
-rwxr-xr-x | src/notification_internal.c | 20 |
2 files changed, 21 insertions, 21 deletions
diff --git a/src/notification.c b/src/notification.c index f20a1b3..51ea959 100755 --- a/src/notification.c +++ b/src/notification.c @@ -106,7 +106,7 @@ EXPORT_API int notification_set_image(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_IMAGE_TYPE_NONE - || type >= NOTIFICATION_IMAGE_TYPE_MAX) + || type > NOTIFICATION_IMAGE_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (noti->b_image_path) { @@ -148,7 +148,7 @@ EXPORT_API int notification_get_image(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_IMAGE_TYPE_NONE - || type >= NOTIFICATION_IMAGE_TYPE_MAX) + || type > NOTIFICATION_IMAGE_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (noti->b_image_path) { @@ -232,7 +232,7 @@ EXPORT_API int notification_set_text(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_TEXT_TYPE_NONE - || type >= NOTIFICATION_TEXT_TYPE_MAX) + || type > NOTIFICATION_TEXT_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (text != NULL) { @@ -449,7 +449,7 @@ EXPORT_API int notification_get_text(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_TEXT_TYPE_NONE - || type >= NOTIFICATION_TEXT_TYPE_MAX) + || type > NOTIFICATION_TEXT_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; @@ -868,7 +868,7 @@ EXPORT_API int notification_set_time_to_text(notification_h noti, notification_t return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_TEXT_TYPE_NONE - || type >= NOTIFICATION_TEXT_TYPE_MAX) + || type > NOTIFICATION_TEXT_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; @@ -895,7 +895,7 @@ EXPORT_API int notification_get_time_from_text(notification_h noti, notification return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_TEXT_TYPE_NONE - || type >= NOTIFICATION_TEXT_TYPE_MAX) + || type > NOTIFICATION_TEXT_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; ret = notification_get_text(noti, type, &ret_text); @@ -924,7 +924,7 @@ EXPORT_API int notification_set_sound(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type < NOTIFICATION_SOUND_TYPE_NONE - || type >= NOTIFICATION_SOUND_TYPE_MAX) + || type > NOTIFICATION_SOUND_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; noti->sound_type = type; @@ -974,7 +974,7 @@ EXPORT_API int notification_set_vibration(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type < NOTIFICATION_VIBRATION_TYPE_NONE - || type >= NOTIFICATION_VIBRATION_TYPE_MAX) + || type > NOTIFICATION_VIBRATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; noti->vibration_type = type; @@ -1025,7 +1025,7 @@ EXPORT_API int notification_set_led(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (operation < NOTIFICATION_LED_OP_OFF - || operation >= NOTIFICATION_LED_OP_MAX) + || operation > NOTIFICATION_LED_OP_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; noti->led_operation = operation; @@ -1350,7 +1350,7 @@ EXPORT_API int notification_get_pkgname(notification_h noti, EXPORT_API int notification_set_layout(notification_h noti, notification_ly_type_e layout) { - if (noti == NULL || (layout < NOTIFICATION_LY_NONE || layout >= NOTIFICATION_LY_MAX)) + if (noti == NULL || (layout < NOTIFICATION_LY_NONE || layout > NOTIFICATION_LY_MAX)) return NOTIFICATION_ERROR_INVALID_PARAMETER; noti->layout = layout; @@ -1412,7 +1412,7 @@ static notification_h _notification_create(notification_type_e type) char pkgid[NOTI_PKGNAME_LEN + 1] = { 0, }; int err; - if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) { + if (type <= NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) { NOTIFICATION_ERR("INVALID TYPE : %d", type); set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER); return NULL; diff --git a/src/notification_internal.c b/src/notification_internal.c index c6b2384..579818c 100755 --- a/src/notification_internal.c +++ b/src/notification_internal.c @@ -468,7 +468,7 @@ EXPORT_API int notification_translate_localized_text(notification_h noti) noti->is_translation = false; - for (; type < NOTIFICATION_TEXT_TYPE_MAX; type++) { + for (; type <= NOTIFICATION_TEXT_TYPE_MAX; type++) { ret = notification_get_text(noti, type, &ret_text); if (ret == NOTIFICATION_ERROR_NONE && ret_text) { if (noti->b_text == NULL) { @@ -761,7 +761,7 @@ EXPORT_API int notification_get_count(notification_type_e type, int notification_clear_for_uid(notification_type_e type, uid_t uid) { - if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) + if (type <= NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; return notification_ipc_request_delete_multiple(type, NULL, uid); @@ -831,7 +831,7 @@ int notification_delete_all_by_type_for_uid(const char *pkgname, int ret = 0; char *caller_pkgname = NULL; - if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) + if (type <= NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (pkgname == NULL) @@ -902,7 +902,7 @@ EXPORT_API int notification_set_execute_option(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_EXECUTE_TYPE_NONE - || type >= NOTIFICATION_EXECUTE_TYPE_MAX) + || type > NOTIFICATION_EXECUTE_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (noti->b_execute_option == NULL) @@ -1048,7 +1048,7 @@ EXPORT_API int notification_get_execute_option(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (type <= NOTIFICATION_EXECUTE_TYPE_NONE - || type >= NOTIFICATION_EXECUTE_TYPE_MAX) + || type > NOTIFICATION_EXECUTE_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; @@ -1113,7 +1113,7 @@ EXPORT_API int notification_insert_for_uid(notification_h noti, return NOTIFICATION_ERROR_INVALID_PARAMETER; if (noti->type <= NOTIFICATION_TYPE_NONE - || noti->type >= NOTIFICATION_TYPE_MAX) + || noti->type > NOTIFICATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; noti->uid = uid; @@ -1306,7 +1306,7 @@ EXPORT_API int notification_post_for_uid(notification_h noti, uid_t uid) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (noti->type <= NOTIFICATION_TYPE_NONE - || noti->type >= NOTIFICATION_TYPE_MAX) + || noti->type > NOTIFICATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; /* Save insert time */ @@ -1352,7 +1352,7 @@ EXPORT_API int notification_delete_all_for_uid(notification_type_e type, uid_t u int ret = 0; char *caller_pkgname = NULL; - if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) + if (type <= NOTIFICATION_TYPE_NONE || type > NOTIFICATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; caller_pkgname = notification_get_pkgname_by_pid(); @@ -1570,7 +1570,7 @@ EXPORT_API int notification_post_with_event_cb_for_uid(notification_h noti, even if (noti == NULL || cb == NULL) return NOTIFICATION_ERROR_INVALID_PARAMETER; - if (noti->type <= NOTIFICATION_TYPE_NONE || noti->type >= NOTIFICATION_TYPE_MAX) + if (noti->type <= NOTIFICATION_TYPE_NONE || noti->type > NOTIFICATION_TYPE_MAX) return NOTIFICATION_ERROR_INVALID_PARAMETER; noti->insert_time = time(NULL); @@ -1644,7 +1644,7 @@ EXPORT_API int notification_send_event_by_priv_id(int priv_id, int event_type) return NOTIFICATION_ERROR_INVALID_PARAMETER; if (!((event_type >= NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1 - && event_type < NOTIFICATION_EVENT_TYPE_MAX) || + && event_type <= NOTIFICATION_EVENT_TYPE_MAX) || (event_type >= NOTIFICATION_EVENT_TYPE_HIDDEN_BY_USER && event_type <= NOTIFICATION_EVENT_TYPE_HIDDEN_BY_TIMEOUT) || (event_type >= NOTIFICATION_EVENT_TYPE_PRESSED |