dlog print error fix 53/196553/1 accepted/tizen/unified/20190104.061237 submit/tizen/20190103.045834
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Wed, 2 Jan 2019 07:58:36 +0000 (13:28 +0530)
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>
Wed, 2 Jan 2019 07:58:36 +0000 (13:28 +0530)
Change-Id: Icb5da82ed5036aa67f2c11606c8d6f2b7df43612
Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
21 files changed:
framework/setting-handler/MsgSettingHandler.cpp
framework/storage-handler/MsgStorageManager.cpp
framework/storage-handler/MsgStorageMessage.cpp
framework/storage-handler/MsgStorageUtil.cpp
framework/transaction-manager/MsgCmdHandlerTransport.cpp
mapi/msg_transport.cpp
plugin/mms_plugin/MmsPluginCodecCommon.cpp
plugin/mms_plugin/MmsPluginTextConvert.cpp
plugin/sms_plugin/SmsPluginCallback.cpp
plugin/sms_plugin/SmsPluginCbMsgHandler.cpp
plugin/sms_plugin/SmsPluginConcatHandler.cpp
plugin/sms_plugin/SmsPluginEventHandler.cpp
plugin/sms_plugin/SmsPluginSatHandler.cpp
plugin/sms_plugin/SmsPluginWapPushHandler.cpp
proxy/MsgHandleControl.cpp
proxy/MsgProxyListener.cpp
utils/MsgSerialize.cpp
utils/MsgTextConvert.cpp
utils/MsgUtilFile.cpp
utils/MsgUtilFunction.cpp
vobject-engine/VMessage.c

index 410cd81..fc78dc5 100755 (executable)
@@ -430,7 +430,7 @@ msg_error_t MsgSetSMSCList(const MSG_SETTING_S *pSetting, bool bSetSim)
                addrLen = strlen(pSetting->option.smscList.smscData[index].smscAddr.address);
 
        if (addrLen > SMSC_ADDR_MAX) {
-               MSG_DEBUG("SMSC address is too long [%lu]", strlen(pSetting->option.smscList.smscData[index].smscAddr.address));
+               MSG_DEBUG("SMSC address is too long [%zu]", strlen(pSetting->option.smscList.smscData[index].smscAddr.address));
                return MSG_ERR_SET_SIM_SET;
        } else if (addrLen < 2) {
                MSG_DEBUG("SMSC address is too short [%d]", addrLen);
index 0f53a96..09b440f 100755 (executable)
@@ -924,7 +924,7 @@ msg_error_t MsgStoRestoreMessage(const char *filepath, msg_id_list_s **result_id
                                break;
 
                                case VMSG_TYPE_SUBJECT : {
-                                       MSG_DEBUG("subject length is [%lu].", strlen(pObject->pszValue[0]));
+                                       MSG_DEBUG("subject length is [%zu].", strlen(pObject->pszValue[0]));
 
                                        if(strlen(pObject->pszValue[0]) > 0) {
                                                strncpy(msgInfo.subject, pObject->pszValue[0], MAX_SUBJECT_LEN);
index 04ab1fc..1957858 100755 (executable)
@@ -2110,7 +2110,7 @@ msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, M
                                        return MSG_ERR_STORAGE_ERROR;
                                }
 
-                               MSG_SEC_DEBUG("Save Message Data into file : size[%lu] name[%s]\n", pMsg->dataSize, fileName);
+                               MSG_SEC_DEBUG("Save Message Data into file : size[%zu] name[%s]\n", pMsg->dataSize, fileName);
 
                                if (MsgWriteIpcFile(fileName, msgData, pMsg->dataSize) == false) {
                                        dbHandle->finalizeQuery();
@@ -2209,7 +2209,7 @@ msg_error_t MsgStoGetMessage(msg_message_id_t msgId, MSG_MESSAGE_INFO_S *pMsg, M
                                }
                                return MSG_ERR_STORAGE_ERROR;
                        }
-                       MSG_SEC_DEBUG("Save Message Data into file : size[%lu] name[%s]\n", pMsg->dataSize, tempFileName);
+                       MSG_SEC_DEBUG("Save Message Data into file : size[%zu] name[%s]\n", pMsg->dataSize, tempFileName);
 
                        if (MsgWriteIpcFile(tempFileName, pDestMsg, pMsg->dataSize) == false) {
                                if(pDestMsg) {
index ca9393e..0f9dd4f 100755 (executable)
@@ -214,7 +214,7 @@ msg_error_t MsgStoCleanAbnormalMmsData()
                dbHandle->getColumnToString(index++, MSG_FILEPATH_LEN_MAX, filePath);
 
                if(strlen(filePath) > 1) {
-                       MSG_DEBUG("strlen(filePath) [%lu]", strlen(filePath));
+                       MSG_DEBUG("strlen(filePath) [%zu]", strlen(filePath));
                        MSG_SEC_DEBUG("filePath [%s]", filePath);
 
                        if(MsgGetFileSize(filePath) < 0) {
index 3b2a8de..4560894 100755 (executable)
@@ -710,7 +710,7 @@ int MsgIncomingMMSConfMsgHandler(const MSG_CMD_S *pCmd, char **ppEvent)
                        javamms_list& listenerList = MsgTransactionManager::instance()->getJavaMMSList();
                        javamms_list::iterator it = listenerList.begin();
 
-                       MSG_DEBUG("listenerList size:%lu ", listenerList.size());
+                       MSG_DEBUG("listenerList size:%zu ", listenerList.size());
 
                        if (msgInfo.networkStatus == MSG_NETWORK_SEND_FAIL && msgInfo.msgType.subType == MSG_SENDREQ_MMS) {
                                for ( ; it != listenerList.end() ; it++) {
index ac709cd..d75f2ba 100755 (executable)
@@ -513,7 +513,7 @@ EXPORT_API int msg_sms_send_message(msg_handle_t handle, msg_struct_t req)
        MSG_MESSAGE_HIDDEN_S *reqmsg = (MSG_MESSAGE_HIDDEN_S*)msg_s->data;
 
        if (reqmsg->dataSize <= 0) {
-               MSG_FATAL("msg size is invalid : [%lu]", reqmsg->dataSize);
+               MSG_FATAL("msg size is invalid : [%zu]", reqmsg->dataSize);
                return MSG_ERR_INVALID_PARAMETER;
        }
 
index f00f85b..4d7bfca 100755 (executable)
@@ -696,7 +696,7 @@ int extract_encoded_word_param(char *encoded_word, char **charset,  char **encod
 
                        if (char_set) {
                                strncpy(char_set, (char*)((start_ptr + 2)), q1_ptr - (start_ptr + 2));
-                               MSG_DEBUG("character set [%s][%lu]", char_set, strlen(char_set));
+                               MSG_DEBUG("character set [%s][%zu]", char_set, strlen(char_set));
                        } else {
                                MSG_DEBUG("fail to calloc");
                                goto __CATCH;
@@ -726,7 +726,7 @@ int extract_encoded_word_param(char *encoded_word, char **charset,  char **encod
                                goto __CATCH;
                        strncpy(l_encoded_text, (char*)(q2_ptr + 1), end_ptr - q2_ptr -1);
 
-                       MSG_DEBUG("encoded text [%s][%lu]", l_encoded_text, strlen(l_encoded_text));
+                       MSG_DEBUG("encoded text [%s][%zu]", l_encoded_text, strlen(l_encoded_text));
                } else {
                        MSG_DEBUG("encoded text is NULL");
                        goto __CATCH;
@@ -816,7 +816,7 @@ char *MsgDecodeText(const char *pOri)
                        }
 
                        if (strcasecmp(encoding, "B") == 0) {
-                               MSG_DEBUG("Base64 encoded text [%s][%lu]", encoded_text, strlen(encoded_text));
+                               MSG_DEBUG("Base64 encoded text [%s][%zu]", encoded_text, strlen(encoded_text));
 
                                decoded_text = (char *)MsgDecodeBase64((unsigned char *)encoded_text, strlen(encoded_text), (ULONG *)&decoded_len);
 
@@ -824,14 +824,14 @@ char *MsgDecodeText(const char *pOri)
                                        char *result_text = NULL;
                                        int result_text_len = 0;
 
-                                       MSG_DEBUG("Base64 decoded text [%s][%lu], outlen [%d]", decoded_text, strlen(decoded_text), decoded_len);
+                                       MSG_DEBUG("Base64 decoded text [%s][%zu], outlen [%d]", decoded_text, strlen(decoded_text), decoded_len);
 
                                        if (MmsPluginTextConvert("UTF-8", charset, decoded_text, decoded_len, &result_text, &result_text_len) == false) {
                                                MSG_DEBUG("MmsPluginTextConvert Fail");
                                        }
 
                                        if (result_text) {
-                                               MSG_DEBUG("Text convert result [%s][%lu]", result_text, strlen(result_text));
+                                               MSG_DEBUG("Text convert result [%s][%zu]", result_text, strlen(result_text));
 
                                                result_string.append(result_text, result_text_len);
 
@@ -848,7 +848,7 @@ char *MsgDecodeText(const char *pOri)
                                char *result_text = NULL;
                                int result_text_len = 0;
 
-                               MSG_DEBUG("Qprint encoded text [%s][%lu]", encoded_text, strlen(encoded_text));
+                               MSG_DEBUG("Qprint encoded text [%s][%zu]", encoded_text, strlen(encoded_text));
 
                                decoded_text = (char *)MsgDecodeQuotePrintable((unsigned char *)encoded_text, strlen(encoded_text), (ULONG *)&decoded_len);
 
@@ -860,7 +860,7 @@ char *MsgDecodeText(const char *pOri)
                                        }
 
                                        if (result_text) {
-                                               MSG_DEBUG("Text convert result [%s][%lu]", result_text, strlen(result_text));
+                                               MSG_DEBUG("Text convert result [%s][%zu]", result_text, strlen(result_text));
 
                                                result_string.append(result_text, result_text_len);
 
index 184d860..86b1c75 100755 (executable)
@@ -104,7 +104,7 @@ bool MmsPluginTextConvert(const char *pToCodeSet, const char *pFromCodeset, cons
        }
 
        if (pDest == NULL || bytes_written == 0 || bytes_read == 0) {
-               MSG_DEBUG("Error in g_convert, pDest = %s, bytes_written = %lu, bytes_read = %lu\n", pDest, bytes_written, bytes_read);
+               MSG_DEBUG("Error in g_convert, pDest = %s, bytes_written = %zu, bytes_read = %zu\n", pDest, bytes_written, bytes_read);
                goto __CATCH;
        }
 
index c203580..ff7f8f3 100755 (executable)
@@ -497,7 +497,7 @@ void TapiEventGetSimMsg(TapiHandle *handle, int result, void *data, void *user_d
        MSG_DEBUG("msgInfo.msgType.subType : %d", msgInfo.msgType.subType);
        MSG_DEBUG("msgInfo.msgType.classType : %d", msgInfo.msgType.classType);
        MSG_DEBUG("msgInfo.displayTime : %ld", msgInfo.displayTime);
-       MSG_DEBUG("msgInfo.dataSize : %lu", msgInfo.dataSize);
+       MSG_DEBUG("msgInfo.dataSize : %zu", msgInfo.dataSize);
        if (msgInfo.bTextSms == true)
                MSG_SEC_DEBUG("msgInfo.msgText : %s", msgInfo.msgText);
        else
index d2b7098..85300ba 100755 (executable)
@@ -810,7 +810,7 @@ void SmsPluginCbMsgHandler::convertCbMsgToMsginfo(SMS_CBMSG_S *pCbMsg, MSG_MESSA
                if (MsgCreateFileName(fileName) == false)
                        THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
 
-               MSG_SEC_DEBUG("Save Message Data into file : size[%lu] name[%s]\n", pMsgInfo->dataSize, fileName);
+               MSG_SEC_DEBUG("Save Message Data into file : size[%zu] name[%s]\n", pMsgInfo->dataSize, fileName);
                if (MsgWriteIpcFile(fileName, tmpBuf, pMsgInfo->dataSize) == false)
                        THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
 
index 4653f7c..b090a68 100755 (executable)
@@ -865,7 +865,7 @@ void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_DELIVER_S *pTpdu,
                pMsgInfo->dataSize = textCvt->convertUCS2ToUTF8((unsigned char*)tmpBuf, bufSize, (unsigned char*)pUserData, DataSize);
        }
 
-       MSG_DEBUG("Data Size [%lu]", pMsgInfo->dataSize);
+       MSG_DEBUG("Data Size [%zu]", pMsgInfo->dataSize);
        MSG_DEBUG("Data [%s]", tmpBuf);
 
 #ifdef MSG_FW_FOR_DEBUG
@@ -889,7 +889,7 @@ printf("\n");
                if (MsgCreateFileName(fileName) == false)
                        THROW(MsgException::FILE_ERROR, "########  MsgCreateFileName Fail !!! #######");
 
-               MSG_SEC_DEBUG("Save Message Data into file : size[%lu] name[%s]\n", pMsgInfo->dataSize, fileName);
+               MSG_SEC_DEBUG("Save Message Data into file : size[%zu] name[%s]\n", pMsgInfo->dataSize, fileName);
                if (MsgWriteIpcFile(fileName, tmpBuf, pMsgInfo->dataSize) == false)
                        THROW(MsgException::FILE_ERROR, "########  MsgWriteIpcFile Fail !!! #######");
 
@@ -993,7 +993,7 @@ void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_SUBMIT_S *pTpdu, c
                pMsgInfo->dataSize = textCvt->convertUCS2ToUTF8((unsigned char*)tmpBuf, bufSize, (unsigned char*)pUserData, DataSize);
        }
 
-       MSG_DEBUG("Data Size [%lu]", pMsgInfo->dataSize);
+       MSG_DEBUG("Data Size [%zu]", pMsgInfo->dataSize);
        MSG_DEBUG("Data [%s]", tmpBuf);
 
        if (pMsgInfo->dataSize > MAX_MSG_TEXT_LEN) {
@@ -1006,7 +1006,7 @@ void SmsPluginConcatHandler::convertConcatToMsginfo(const SMS_SUBMIT_S *pTpdu, c
                if (MsgCreateFileName(fileName) == false)
                        THROW(MsgException::FILE_ERROR, "########  MsgCreateFileName Fail !!! #######");
 
-               MSG_SEC_DEBUG("Save Message Data into file : size[%lu] name[%s]\n", pMsgInfo->dataSize, fileName);
+               MSG_SEC_DEBUG("Save Message Data into file : size[%zu] name[%s]\n", pMsgInfo->dataSize, fileName);
                if (MsgWriteIpcFile(fileName, tmpBuf, pMsgInfo->dataSize) == false)
                        THROW(MsgException::FILE_ERROR, "########  MsgWriteIpcFile Fail !!! #######");
 
index cd522e1..8b8c8f4 100755 (executable)
@@ -295,7 +295,7 @@ void SmsPluginEventHandler::handleMsgIncoming(TapiHandle *handle, SMS_TPDU_S *pT
        MSG_DEBUG("msgInfo.displayTime : %ld", msgInfo.displayTime);
        MSG_DEBUG("msgInfo.msgPort.valid : %d", msgInfo.msgPort.valid);
        MSG_DEBUG("msgInfo.encodeType : %d", msgInfo.encodeType);
-       MSG_DEBUG("msgInfo.dataSize : %lu", msgInfo.dataSize);
+       MSG_DEBUG("msgInfo.dataSize : %zu", msgInfo.dataSize);
        MSG_DEBUG("msgInfo.sim_idx : %d", msgInfo.sim_idx);
 
        if (msgInfo.bTextSms == true) {
index d169d03..8a40e70 100755 (executable)
@@ -183,7 +183,7 @@ void SmsPluginSatHandler::sendSms(TapiHandle *handle, void *pData)
                smsc.npi = pSmsData->address.npi;
                snprintf(smsc.address, sizeof(smsc.address), "%s", pSmsData->address.diallingNumber);
 
-               MSG_SEC_DEBUG("SCA TON[%d], NPI[%d], LEN[%lu], ADDR[%s]", smsc.ton, smsc.npi, strlen(smsc.address), smsc.address);
+               MSG_SEC_DEBUG("SCA TON[%d], NPI[%d], LEN[%zu], ADDR[%s]", smsc.ton, smsc.npi, strlen(smsc.address), smsc.address);
        } else {
                /* Set SMSC Options */
                SmsPluginTransport::instance()->setSmscOptions(simIndex, &smsc);
index bc9cca1..47d0da9 100755 (executable)
@@ -1752,7 +1752,7 @@ void SmsPluginWapPushHandler::handleSLMessage(char* pPushBody, int PushBodyLen,
        msgInfo.sim_idx = simIndex;
        getDisplayName(msgInfo.msgType.subType, msgInfo.addressList[0].addressVal);
 
-       MSG_DEBUG("dataSize : %lu", msgInfo.dataSize);
+       MSG_DEBUG("dataSize : %zu", msgInfo.dataSize);
 
        /** Add WAP Push Msg into DB */
        err = SmsPluginStorage::instance()->checkMessage(&msgInfo);
index 58c54f9..430872d 100755 (executable)
@@ -234,7 +234,7 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_I
                pDest->msgPort.srcPort = pSrc->srcPort;
        }
 
-       MSG_DEBUG("nSize = %lu",  pSrc->dataSize);
+       MSG_DEBUG("nSize = %zu",  pSrc->dataSize);
        MSG_DEBUG("mainType = %d",  pSrc->mainType);
 
        if (pSrc->mainType == MSG_SMS_TYPE) {
@@ -252,7 +252,7 @@ void MsgHandle::convertMsgStruct(const MSG_MESSAGE_HIDDEN_S *pSrc, MSG_MESSAGE_I
                                if (MsgCreateFileName(fileName) == false)
                                        THROW(MsgException::FILE_ERROR, "MsgCreateFileName error");
 
-                               MSG_SEC_DEBUG("Save pSrc->pData into file : size[%lu] name[%s]", pDest->dataSize, fileName);
+                               MSG_SEC_DEBUG("Save pSrc->pData into file : size[%zu] name[%s]", pDest->dataSize, fileName);
 
                                if (MsgWriteIpcFile(fileName, (char*)pSrc->pData, pSrc->dataSize) == false)
                                        THROW(MsgException::FILE_ERROR, "MsgWriteIpcFile error");
index efec00f..362af2d 100755 (executable)
@@ -1344,7 +1344,7 @@ void MsgProxyListener::insertOpenHandleSet(MsgHandle* pMsgHandle)
        handle_set::iterator it = openHandleSet.find(pMsgHandle);
        if (it == openHandleSet.end()) {
                openHandleSet.insert(pMsgHandle);
-               MSG_DEBUG("New handle is added. current count = [%lu]", openHandleSet.size());
+               MSG_DEBUG("New handle is added. current count = [%zu]", openHandleSet.size());
        }
 }
 
index 5a35b3d..dbdff4e 100755 (executable)
@@ -709,7 +709,7 @@ int MsgSerializeMms(const MMS_DATA_S *pMsgData, char **pValue)
                offset += sizeof(MMS_MULTIPART_DATA_S);
 
                MSG_DEBUG("SMIL file path = [%s]", pMsgData->smil->szFilePath);
-               MSG_DEBUG("SMIL nMultipartDataLen = [%lu]", pMsgData->smil->nMultipartDataLen);
+               MSG_DEBUG("SMIL nMultipartDataLen = [%zu]", pMsgData->smil->nMultipartDataLen);
 
                if (pMsgData->smil->pMultipartData) {
                        memcpy(buf + offset, pMsgData->smil->pMultipartData, sizeof(char)*pMsgData->smil->nMultipartDataLen);
@@ -874,7 +874,7 @@ int MsgDeserializeMmsData(char* value, int value_len, MMS_DATA_S **ppMmsData)
                offset += sizeof(MMS_MULTIPART_DATA_S);
 
                MSG_SEC_DEBUG("SMIL file path = [%s]", pMmsData->smil->szFilePath);
-               MSG_DEBUG("SMIL nMultipartDataLen = [%lu]", pMmsData->smil->nMultipartDataLen);
+               MSG_DEBUG("SMIL nMultipartDataLen = [%zu]", pMmsData->smil->nMultipartDataLen);
 
                if (pMmsData->smil->nMultipartDataLen > 0) {
                        pMmsData->smil->pMultipartData = (char *)calloc(1, sizeof(char)*pMmsData->smil->nMultipartDataLen);
index de888e7..ac9c994 100755 (executable)
@@ -451,7 +451,7 @@ int MsgTextConvert::convertUTF8ToGSM7bit(OUT unsigned char *pDestText, IN int ma
        memset(pUCS2Text, 0x00, maxUCS2Length * sizeof(WCHAR));
 
        MSG_DEBUG("srcTextLen = %d", srcTextLen);
-       MSG_DEBUG("temp buffer size = %lu", maxUCS2Length * sizeof(WCHAR));
+       MSG_DEBUG("temp buffer size = %zu", maxUCS2Length * sizeof(WCHAR));
        MSG_DEBUG("max dest Length = %d", maxLength);
 
        ucs2Length = convertUTF8ToUCS2((unsigned char*)pUCS2Text, maxUCS2Length * sizeof(WCHAR), pSrcText, srcTextLen);
@@ -536,7 +536,7 @@ int MsgTextConvert::convertUTF8ToAuto(OUT unsigned char *pDestText, IN int maxLe
        memset(pUCS2Text, 0x00, maxUCS2Length * sizeof(WCHAR));
 
        MSG_DEBUG("srcTextLen = %d", srcTextLen);
-       MSG_DEBUG("temp buffer size = %lu", maxUCS2Length * sizeof(WCHAR));
+       MSG_DEBUG("temp buffer size = %zu", maxUCS2Length * sizeof(WCHAR));
        MSG_DEBUG("max dest Length = %d", maxLength);
 
        ucs2Length = convertUTF8ToUCS2((unsigned char*)pUCS2Text, maxUCS2Length * sizeof(WCHAR), pSrcText, srcTextLen);
index 46c26e9..c748e0e 100755 (executable)
@@ -238,7 +238,7 @@ size_t MsgWriteFile(const char *pData, size_t size, size_t count, FILE *pFile)
 
        size_t nWrite = 0;
 
-       MSG_DEBUG("[FILE] pData [%p], size [%lu], count [%lu], pFile [%p]", pData, size, count, pFile);
+       MSG_DEBUG("[FILE] pData [%p], size [%zu], count [%zu], pFile [%p]", pData, size, count, pFile);
 
        try {
                nWrite = fwrite(pData, size, count, pFile);
index 9f857dd..c98b5c2 100755 (executable)
@@ -1146,7 +1146,7 @@ msg_error_t msg_write_text_to_msg_info(MSG_MESSAGE_INFO_S *pMsgInfo, char *text)
                        return MSG_ERR_STORAGE_ERROR;
                }
 
-               MSG_SEC_DEBUG("Save text into file : size[%lu] name[%s]", pMsgInfo->dataSize, fileName);
+               MSG_SEC_DEBUG("Save text into file : size[%zu] name[%s]", pMsgInfo->dataSize, fileName);
 
                if (MsgWriteIpcFile(fileName, text, pMsgInfo->dataSize) == false) {
                        MSG_DEBUG("MsgWriteIpcFile error");
index d3ac003..a81a091 100755 (executable)
@@ -1374,7 +1374,7 @@ __VMsgTypeEncode(VObject *pTypeObj, char *pType)
 
                memset(pRes, '\0', ((len * 8 / 6) + 48));
                _VB64Encode(pRes, pEncode, biLen);
-               VDATA_TRACE("Origin Size: %d, Allocated Size %d, Coverted Size: %lu\n", biLen, (len * 8 / 6) + 48, strlen(pRes));
+               VDATA_TRACE("Origin Size: %d, Allocated Size %d, Coverted Size: %zu\n", biLen, (len * 8 / 6) + 48, strlen(pRes));
                VFREE(pEncode);
        } else {
                if ((pRes = (char *)calloc(1, len+30)) == NULL) {