fix build warning 58/113758/2
authorJongkyu Koo <jk.koo@samsung.com>
Thu, 9 Feb 2017 00:23:31 +0000 (09:23 +0900)
committerJongkyu Koo <jk.koo@samsung.com>
Thu, 9 Feb 2017 02:10:13 +0000 (18:10 -0800)
Change-Id: Id63c434102dcd73ae232b5f233942c6622f1b4b7
Signed-off-by: Jongkyu Koo <jk.koo@samsung.com>
common/ctsvc_inotify.c
common/ctsvc_vcard.c

index 4e05c36..cbe59ca 100644 (file)
@@ -581,7 +581,7 @@ void ctsvc_inotify_close(void)
        }
 }
 
-static const char* __ctsvc_inotify_get_username(uid_t uid)
+static char* __ctsvc_inotify_get_username(uid_t uid)
 {
        struct passwd pwd;
        struct passwd *pwd_result;
@@ -605,7 +605,7 @@ char*  ctsvc_inotify_makepath(const char *file)
        int path_len = 0;
        char *path = NULL;
        uid_t uid = getuid();
-       const char *user_name = NULL;
+       char *user_name = NULL;
 
 #ifdef _CONTACTS_IPC_CLIENT
        if (ctsvc_client_is_in_system_session()) {
index 41bf611..d093411 100644 (file)
@@ -25,6 +25,7 @@
 #include <unicode/ucnv.h>
 #include <unicode/ustring.h>
 #include <tzplatform_config.h>
+#include <limits.h>
 
 #ifdef _CONTACTS_IPC_CLIENT
 #include "ctsvc_client_ipc.h"
@@ -4439,8 +4440,7 @@ EXPORT_API int contacts_vcard_parse_to_contacts(const char *vcard_stream, contac
 
 static int  _ctsvc_safe_add(unsigned int* total, unsigned int value)
 {
-       const unsigned int unsigned_int_max = 4294967295;
-       if (unsigned_int_max -*total < value) {
+       if (UINT_MAX -*total < value) {
                ERR("overflow occurs when %d + %d", *total, value);
                return CONTACTS_ERROR_SYSTEM;
        }