*r = '\\';
r++;
*r = 'n';
- }
- else {
+ } else {
*r = *s;
}
break;
str_len++;
if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
- if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+ if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
return -1;
- else {
+ } else {
int pos_temp = r-(*buf+len);
*buf = tmp;
r = (char *)(*buf+len+pos_temp);
str_len++;
if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
- if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+ if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
return -1;
- else {
+ } else {
int pos_temp = r-(*buf+len);
*buf = tmp;
r = (char *)(*buf+len+pos_temp);
str_len++;
if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
- if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+ if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
return -1;
- else {
+ } else {
int pos_temp = r-(*buf+len);
*buf = tmp;
r = (char *)(*buf+len+pos_temp);
s++;
if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
- if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+ if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
return -1;
- else {
+ } else {
int pos_temp = r-(*buf+len);
*buf = tmp;
r = (char *)(*buf+len+pos_temp);
}
}
*r = *s;
- }
- else {
+ } else {
*r = *s;
}
break;
str_len++;
if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
- if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+ if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
return -1;
- else {
+ } else {
int pos_temp = r-(*buf+len);
*buf = tmp;
r = (char *)(*buf+len+pos_temp);
s++;
if (*buf_size < str_len+len+1) {
*buf_size = *buf_size * 2;
- if (NULL == (tmp = (char *)realloc(*buf, *buf_size)))
+ if (NULL == (tmp = (char *)realloc(*buf, *buf_size))) {
return -1;
- else {
+ } else {
int pos_temp = r-(*buf+len);
*buf = tmp;
r = (char *)(*buf+len+pos_temp);
}
}
*r = *s;
- }
- else {
+ } else {
*r = *s;
}
break;
s++;
}
len_temp = str_len;
- }
- else {
+ } else {
len_temp = snprintf(*buf+len, *buf_size-len+1, "%s", safe_str);
}
len += len_temp;
if ( !pObject )\
{\
vmsg_free_vtree_memory(pMessage);\
- return false;\
+ return NULL;\
}\
if (pMessage->pTop == NULL)\
{\
if ( !pObject )\
{\
vmsg_free_vtree_memory(pMessage);\
- return false;\
+ return NULL;\
}\
if (pBody->pTop == NULL)\
{\
if ( !pObject )\
{\
vmsg_free_vtree_memory(pMessage);\
- return false;\
+ return NULL;\
}\
if (pCard->pTop == NULL)\
{\
free(pObject);\
pObject = NULL;\
}\
- return false;\
+ return NULL;\
}
{
char str[17] = {0, };
- snprintf(str, 17, "%04d%02d%02dT%02d%02d%02dZ",
+ int wrn = snprintf(str, 17, "%04d%02d%02dT%02d%02d%02dZ",
tm->tm_year + 1900,
tm->tm_mon +1,
tm->tm_mday,
tm->tm_hour,
tm->tm_min,
tm->tm_sec);
+ if(wrn < 0)
+ MSG_DEBUG("snprintf was failed ");
return strdup(str);
}
int mon = 0;
int hour = 0;
mon = tm->tm_mon + 1;
+ int wrn=0;
if (tm->tm_hour >= 12)
- strncpy(APM, "PM", 2);
+ strncpy(APM, "PM", 3);
else
- strncpy(APM, "AM", 2);
+ strncpy(APM, "AM", 3);
if (tm->tm_hour > 12)
hour = tm->tm_hour - 12;
switch(mon) {
case 1:
- strncpy(month, "Jan", 3);
+ strncpy(month, "Jan", 4);
break;
case 2:
- strncpy(month, "Feb", 3);
+ strncpy(month, "Feb", 4);
break;
case 3:
- strncpy(month, "Mar", 3);
+ strncpy(month, "Mar", 4);
break;
case 4:
- strncpy(month, "Apr", 3);
+ strncpy(month, "Apr", 4);
break;
case 5:
- strncpy(month, "May", 3);
+ strncpy(month, "May", 4);
break;
case 6:
- strncpy(month, "Jun", 3);
+ strncpy(month, "Jun", 4);
break;
case 7:
- strncpy(month, "Jul", 3);
+ strncpy(month, "Jul", 4);
break;
case 8:
- strncpy(month, "Aug", 3);
+ strncpy(month, "Aug", 4);
break;
case 9:
- strncpy(month, "Sep", 3);
+ strncpy(month, "Sep", 4);
break;
case 10:
- strncpy(month, "Oct", 3);
+ strncpy(month, "Oct", 4);
break;
case 11:
- strncpy(month, "Nov", 3);
+ strncpy(month, "Nov", 4);
break;
case 12:
- strncpy(month, "Dec", 3);
+ strncpy(month, "Dec", 4);
break;
default:
MSG_DEBUG("invalid month number");
break;
}
- snprintf(str, 22, "%d:%02d%s, %04d %s %d",
+ wrn = snprintf(str, 22, "%d:%02d%s, %04d %s %d",
hour,
tm->tm_min,
APM,
tm->tm_year + 1900,
month,
tm->tm_mday);
+ if(wrn < 0)
+ MSG_DEBUG("snprintf was failed ");
return strdup(str);
}
buf_copy = (char *)calloc(1, *buf_size);
+ if (buf_copy == NULL)
+ return -1;
+
s = *buf;
r = buf_copy;
len = result_len = 0;
if (NULL == (tmp = (char *)realloc(buf_copy, *buf_size))) {
free(buf_copy);
return -1;
- }
- else {
+ } else {
buf_copy = tmp;
r = (buf_copy + result_len);
}
encode_64 = true;
}
- if ('\r' == *s)
+ if ('\r' == *s) {
len--;
- else if ('\n' == *s) {
+ } else if ('\n' == *s) {
len = -1;
char_len = 0;
content_start = false;
char* msgText = NULL;
#if 0
char filePath[MSG_FILEPATH_LEN_MAX] = {0, };
- if(pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS)
+ if(pMsg->msgType.subType == MSG_NOTIFICATIONIND_MMS) {
pFileData = MsgOpenAndReadMmsFile(pMsg->msgData, 0, -1, &fileSize);
- else {
+ } else {
err = MsgStoGetMmsRawFilePath(pDbHandle, pMsg->msgId, filePath);
if (err != MSG_SUCCESS)
}
} else {
fileSize = strlen(pMsg->msgData);
- pFileData = (char *)calloc(1, fileSize+1);
+ pFileData = new char[fileSize+1];
if (!pFileData)
goto __CATCH_FAIL__;
+ memset(pFileData, 0x00, fileSize+1);
snprintf(pFileData, fileSize, "%s", pMsg->msgData);
}
pObject->valueCount = 1;
if (pFileData) {
- free(pFileData);
+ delete [] pFileData;
pFileData = NULL;
}
}
val += sizeof("CHARSET");
break;
}
- }
- else if (':' == *val) {
+ } else if (':' == *val) {
return NULL;
}
val++;
if (temp) {
long len = (long)temp - (long)src;
*prefix = (char *)calloc(len+1, sizeof(char));
- snprintf(*prefix, len+1, "%s", src);
- }
- else {
+ if (*prefix) {
+ snprintf(*prefix, len+1, "%s", src);
+ } else {
+ *prefix = NULL;
+ }
+ } else {
*prefix = NULL;
}
}
cursor++;
}
- }
- else {
+ } else {
while (*cursor) {
if ('\r' == *cursor && '\n' == *(cursor+1) && ' ' != *(cursor+2))
break;
if (src == cursor) {
*dest = NULL;
return NULL;
- }
- else {
+ } else {
int len = 0;
char temp = *cursor;
char *new_dest;
break;
}
- if (VMSG_MAXIMUM_VALUE == i)
+ if (VMSG_MAXIMUM_VALUE == i) {
return VMSG_VALUE_NONE;
- else {
+ } else {
*vcard = new_start;
return i;
}
decoded_str = g_base64_decode(src, &size);
dest = (char *)calloc((src-val)+size+1, sizeof(char));
+ if (NULL == dest) {
+ g_free(decoded_str);
+ return NULL;
+ }
snprintf(dest, (src-val)+1, "%s", val);
snprintf(dest+(src-val), size+1, "%s", decoded_str);
g_free(decoded_str);
pMsg->folderId = MSG_DRAFT_ID;
pMsg->direction = MSG_DIRECTION_TYPE_MO;
pMsg->networkStatus = MSG_NETWORK_NOT_SEND;
- }
- else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_INBOX]) == 0) {
+ } else if (strcmp(temp, content_name[VMSG_INDICATION_MSG_BOX_INBOX]) == 0) {
pMsg->folderId = MSG_INBOX_ID;
pMsg->direction = MSG_DIRECTION_TYPE_MT;
pMsg->networkStatus = MSG_NETWORK_RECEIVED;
pMsg->folderId = MSG_SENTBOX_ID;
pMsg->direction = MSG_DIRECTION_TYPE_MO;
pMsg->networkStatus = MSG_NETWORK_SEND_SUCCESS;
- } else
+ } else {
return MSG_ERR_INVALID_PARAMETER;
+ }
MSG_DEBUG("pMsg->folderId = %d", pMsg->folderId);
return MSG_SUCCESS;
pMsg->msgType.mainType = MSG_SMS_TYPE;
pMsg->msgType.subType = MSG_NORMAL_SMS;
pMsg->msgType.classType = MSG_CLASS_NONE;
- }
- else if (strcmp(temp, content_name[VMSG_INDICATION_MESSAGE_TYPE_INET]) == 0) {
+ } else if (strcmp(temp, content_name[VMSG_INDICATION_MESSAGE_TYPE_INET]) == 0) {
/* To do */
- }
- else
+ } else {
return MSG_ERR_INVALID_PARAMETER;
+ }
MSG_DEBUG("pMsg->msgType.subType = %d", pMsg->msgType.subType);
return MSG_SUCCESS;
if (new_start) {
cursor = new_start;
continue;
- }
- else
+ } else {
break;
+ }
}
}
g_free(val);
g_free(prefix);
return MSG_SUCCESS;
- } else
+ } else {
break;
+ }
default:
MSG_ERR("Invalid parameter : __msgsvc_vmsg_check_content_type() Failed(%d)", type);
g_free(val);