int listCnt = sizeof(tableList)/sizeof(char *);
int rowCnt = 0;
MsgDbHandler *dbHandle = getDbHandle();
+ signed char folder_id;
/* Get conversation ID from Folder */
memset(sqlQuery, 0x00, sizeof(sqlQuery));
/*** **/
/*** Delete Sim Message In Folder **/
- if ((unsigned char)folderId >= (unsigned char)MSG_INBOX_ID) {
+ folder_id = (signed char)folderId;
+ if (folder_id >= MSG_INBOX_ID) {
memset(sqlQuery, 0x00, sizeof(sqlQuery));
snprintf(sqlQuery, sizeof(sqlQuery), "SELECT MSG_ID FROM %s WHERE FOLDER_ID = %d AND STORAGE_ID = %d",
err = MsgStoUpdateConversation(dbHandle, convId);
/* update notification */
- if ((unsigned char)destFolderId != (unsigned char)MSG_SPAMBOX_ID)
+ signed char dest_folder_id = (signed char)destFolderId;
+ if (dest_folder_id != MSG_SPAMBOX_ID)
MsgRefreshAllNotification(true, false, MSG_ACTIVE_NOTI_TYPE_NONE);
return err;
return MSG_ERR_INVALID_PARAMETER;
}
- if ((unsigned char)folder_id >= (unsigned char)MSG_MAX_FOLDER_ID) {
+ signed char folderId = (signed char)folder_id;
+ if (folderId >= MSG_MAX_FOLDER_ID) {
MSG_DEBUG("folderId is invalid [%d]", folder_id);
return MSG_ERR_INVALID_PARAMETER;
}
dbHandle->endTrans(true);
- if ((unsigned char)folderId == (unsigned char)MSG_INBOX_ID) {
+ signed char folder_id = (signed char)folderId;
+ if (folder_id == MSG_INBOX_ID) {
msgType.classType = MSG_CLASS_NONE;
/** Set memory status in SIM */
char originAddress[MAX_ADDRESS_VAL_LEN + 1] = {0, };
bool isDisplayName = false;
- if ((unsigned char)(pMsg->folderId) == (unsigned char)MSG_INBOX_ID) {
- strcpy(originAddress, pMsg->addressList[0].addressVal);
+ signed char folderId = (signed char)pMsg->folderId;
+ if (folderId == (signed char)MSG_INBOX_ID) {
+ snprintf(originAddress, sizeof(originAddress), "%s", pMsg->addressList[0].addressVal);
}
needCharset = true; /* as per android */
MSGSVC_VMSG_APPEND_STR(buf, buf_size, len, MSGSVC_CRLF);
needCharset = true; /* as per android */
+ signed char folderId;
for (int i = 0; i < pMsg->nAddressCnt; ++i) {
char originAddress[MAX_ADDRESS_VAL_LEN + 1] = {0, };
bool isDisplayName = false;
- if (pMsg->folderId == MSG_SENTBOX_ID) {
- strcpy(originAddress, pMsg->addressList[0].addressVal);
+ folderId = (signed char)pMsg->folderId;
+ if (folderId == MSG_SENTBOX_ID) {
+ snprintf(originAddress, sizeof(originAddress), "%s", pMsg->addressList[0].addressVal);
}
if (strlen(originAddress) > 0) {
pMsg->dataSize = strlen(pMsg->msgText);
free(decodedText);
} else {
- strcpy(pMsg->msgText, "");
+ pMsg->msgText[0] = '\0';
pMsg->dataSize = 0;
}
}