Change strcmp to g_strcmp0 95/152695/1
authorHaejeong Kim <backto.kim@samsung.com>
Wed, 27 Sep 2017 02:01:21 +0000 (11:01 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Wed, 27 Sep 2017 02:01:21 +0000 (11:01 +0900)
Change-Id: Ie8764b3d1240773c5ff9ce9f2ace83cfed64fac4

packaging/capi-content-media-content.spec
src/media_util_private.c

index 691fc81..23dd507 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-content-media-content
 Summary:    A Media content library in Tizen Native API
-Version:    0.3.28
+Version:    0.3.29
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b41e3e8..06e38ae 100755 (executable)
@@ -101,7 +101,7 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
                dir = g_dir_open(search_path, 0, &error);
                if (dir != NULL && error == NULL) {
                        while ((name = g_dir_read_name(dir))) {
-                               if (strcmp(name, scan_ignore) == 0) {
+                               if (g_strcmp0(name, scan_ignore) == 0) {
                                        media_content_sec_debug("Ignore path[%s]", search_path);
                                        find = TRUE;
                                        break;
@@ -124,18 +124,18 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
                        break;
                } else {
                        /*If root path, Stop Scanning*/
-                       if ((storage_type == MEDIA_SVC_STORAGE_INTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_INTERNAL) && strcmp(search_path, MEDIA_ROOT_PATH_INTERNAL) == 0)) {
+                       if ((storage_type == MEDIA_SVC_STORAGE_INTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_INTERNAL) && g_strcmp0(search_path, MEDIA_ROOT_PATH_INTERNAL) == 0)) {
                                break;
-                       } else if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_SDCARD)) && (strcmp(search_path, MEDIA_ROOT_PATH_SDCARD) == 0)) {
+                       } else if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (STRING_VALID(MEDIA_ROOT_PATH_SDCARD)) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_SDCARD) == 0)) {
                                break;
-                       } else if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) && (STRING_VALID(MEDIA_ROOT_PATH_DISC)) && (strcmp(search_path, MEDIA_ROOT_PATH_DISC) == 0)) {
+                       } else if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) && (STRING_VALID(MEDIA_ROOT_PATH_DISC)) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_DISC) == 0)) {
                                break;
                        } else if (storage_type == MEDIA_SVC_STORAGE_EXTERNAL_USB) {
                                char *parent_folder_path = NULL;
                                bool is_root = FALSE;
 
                                parent_folder_path = g_path_get_dirname(search_path);
-                               if (STRING_VALID(MEDIA_ROOT_PATH_USB) && STRING_VALID(parent_folder_path) && (strcmp(parent_folder_path, MEDIA_ROOT_PATH_USB) == 0))
+                               if (STRING_VALID(MEDIA_ROOT_PATH_USB) && STRING_VALID(parent_folder_path) && (g_strcmp0(parent_folder_path, MEDIA_ROOT_PATH_USB) == 0))
                                        is_root = TRUE;
 
                                SAFE_FREE(parent_folder_path);
@@ -145,7 +145,7 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
                        }
 #ifdef _USE_SENIOR_MODE
                        if (_media_content_is_support_senior_mode()) {
-                               if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (strcmp(search_path, MEDIA_ROOT_PATH_SENIOR_MODE) == 0))
+                               if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (g_strcmp0(search_path, MEDIA_ROOT_PATH_SENIOR_MODE) == 0))
                                        break;
                        }
 #endif
@@ -221,7 +221,7 @@ int _media_content_replace_path_in_condition(const char *condition, char *replac
                goto ERROR;
        }
 
-       if (strcmp(find_str, to_replace_str))
+       if (g_strcmp0(find_str, to_replace_str))
                find = strstr(new_condition, find_str);
 
        while (find != NULL) {