pFolderList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(MSG_FOLDER_INFO_S *));
- if (pFolderList->msg_struct_info == NULL){
- dbHandle->freeTable();
- return MSG_ERR_NULL_POINTER;
- }
-
msg_struct_s* pTmp = NULL;
for (int i = 0; i < rowCnt; i++) {
int Sms3gpp2MsgCodec::encodeUserData(const unsigned char* src, unsigned char *dest, int src_size)
{
- int i, j = 0;
+ int i, j;
int shift = 0;
unsigned char *tmp = (unsigned char *)calloc(1, src_size+1);
-
- if (tmp == NULL){
- MSG_ERR("failed to allocate memory");
- goto END;
- }
-
for (i = 0; i < src_size; i++) {
tmp[i] = src[i] << 1;
}
+ j = 0;
for (i = 0; i < src_size; i++) {
shift = j % 7;
dest[j++] = (tmp[i] << shift) + (tmp[i+1] >> (7-shift));
tmp = NULL;
}
-END:
return j;
}
pAddrlist->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(msg_struct_t));
- if (pAddrlist->msg_struct_info == NULL){
- pDbHandle->freeTable();
- return MSG_ERR_NULL_POINTER;
- }
-
for (int i = 0; i < rowCnt; i++) {
pAddrlist->msg_struct_info[i] = (msg_struct_t)new msg_struct_s;
pTmp = (msg_struct_s *)pAddrlist->msg_struct_info[i];
pThreadViewList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(msg_struct_t));
- if (pThreadViewList->msg_struct_info == NULL){
- dbHandle->freeTable();
- return MSG_ERR_NULL_POINTER;
- }
-
MSG_THREAD_VIEW_S *pTmp = NULL;
msg_struct_s *thread_t = NULL;
MSG_DEBUG("pConvViewList->nCount [%d]", pConvViewList->nCount);
pConvViewList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(msg_struct_t));
-
- if (pConvViewList->msg_struct_info = NULL){
- dbHandle->freeTable();
- return MSG_ERR_NULL_POINTER;
- }
-
memset(pConvViewList->msg_struct_info, 0x00, sizeof(msg_struct_t) * rowCnt);
msg_struct_s *conv = NULL;
pRejectMsgList->msg_struct_info = (msg_struct_t *)calloc(rowCnt, sizeof(MSG_REJECT_MSG_INFO_S *));
- if (pRejectMsgList->msg_struct_info == NULL){
- dbHandle->freeTable();
- return MSG_ERR_NULL_POINTER;
- }
-
msg_struct_s* pTmp = NULL;
for (int i = 0; i < rowCnt; i++) {