memset(p_msg_info->msgText, 0x00, sizeof(p_msg_info->msgText));
p_msg_info->dataSize = 0;
} else if (p_deliver->cmas_data.data_len > MAX_MSG_TEXT_LEN) {
- sprintf(p_msg_info->msgText, "[Broken Message]");
+ snprintf(p_msg_info->msgText, MAX_MSG_TEXT_LEN, "[Broken Message]");
p_msg_info->dataSize = strlen(p_msg_info->msgData);
return;
} else {
memset(p_msg_info->msgText, 0x00, sizeof(p_msg_info->msgText));
p_msg_info->dataSize = 0;
} else if (p_deliver->user_data.data_len > MAX_MSG_TEXT_LEN) {
- sprintf(p_msg_info->msgText, "[Broken Message]");
+ snprintf(p_msg_info->msgText, MAX_MSG_TEXT_LEN, "[Broken Message]");
p_msg_info->dataSize = strlen(p_msg_info->msgData);
return;
} else {
if (qValue > 100) {
qValue = qValue - 100;
qValue = qValue / 1000;
- sprintf((char*)*pDecodedString, "; q=%.3f", qValue);
+ snprintf((char*)*pDecodedString, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "; q=%.3f", qValue);
} else {
/* qValue variable is divided by 100. And it's multiplied by 100.
It's to resolve problem of changed 0.01 of qValue. */
qValue = qValue / 100;
qValueTemp = (unsigned long)(qValue * 100);
if (0 == (qValueTemp % 10))
- sprintf((char*)*pDecodedString, "; q=%.1f", qValue);
+ snprintf((char*)*pDecodedString, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "; q=%.1f", qValue);
else
- sprintf((char*)*pDecodedString, "; q=%.2f", qValue);
+ snprintf((char*)*pDecodedString, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "; q=%.2f", qValue);
}
return;
}
MSG_DEBUG("WspLHeaderDecodeParameter: 0x03 MemAlloc failed\n");
return;
} else {
- sprintf((char*)param, "Type=%i", (int)wspHeaderDecodeInteger(data + 1));
+ snprintf((char*)param, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "Type=%i", (int)wspHeaderDecodeInteger(data + 1));
}
break;
case 0x08:
MSG_DEBUG("WspLHeaderDecodeParameter:0x08 MemAlloc failed\n");
return;
} else {
- sprintf((char*)param, "Padding=%i", (int)wspHeaderDecodeInteger(data + 1));
+ snprintf((char*)param, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "Padding=%i", (int)wspHeaderDecodeInteger(data + 1));
}
break;
case 0x05:
/* typed version */
unsigned char majorVer = ((data[0] & 0x7f) >> 4);
unsigned char minorVer = data[0] & 0x0f;
- sprintf((char*)*pDecodedString, "level=%u.%u", majorVer, minorVer);
+ snprintf((char*)*pDecodedString, sizeof(char)*WSP_STANDARD_STR_LEN_MAX, "level=%u.%u", majorVer, minorVer);
}
return;