*/
int MsgConvertUTF8toUCS2(unsigned char *pDestText, int maxLength, const unsigned char *pSrcText, int srcTextLen)
{
- int textLen;
+ size_t textLen;
unsigned char *unicodeTemp = (unsigned char*)pDestText;
int ucs2Length = 0;
- int remainedBuffer = maxLength;
+ size_t remainedBuffer = maxLength;
#ifdef CONVERT_DUMP
int srcLen = srcTextLen;
if (cd > 0)
{
- err = g_iconv(cd, (char**)&pSrcText, (gsize*)&textLen, (char**)&unicodeTemp, (gsize*)&remainedBuffer);
+ err = g_iconv(cd, (char**)&pSrcText, &textLen, (char**)&unicodeTemp, &remainedBuffer);
if (err < 0) {
fprintf(stderr, "g_iconv has failed\n");
g_iconv_close(cd);
*/
int MsgConvertUCS2toUTF8(unsigned char *pDestText, int maxLength, const unsigned char *pSrcText, int srcTextLen)
{
- int remainedBuffer = maxLength;
+ size_t remainedBuffer = maxLength;
+ size_t srcLen = srcTextLen;
int utf8Length;
#ifdef CONVERT_DUMP
- int srcLen = srcTextLen;
const unsigned char * pTempSrcText = pSrcText;
#endif
unsigned char * pTempDestText = pDestText;
- if(srcTextLen == 0 || pSrcText == NULL || pDestText == NULL || maxLength == 0)
+ if(srcLen == 0 || pSrcText == NULL || pDestText == NULL || remainedBuffer == 0)
{
fprintf(stderr, "UCS2 to UTF8 Failed as text length is 0\n");
return FALSE;
if (cd > 0)
{
- err = g_iconv(cd, (char**)&pSrcText, (gsize*)&srcTextLen, (char**)&pDestText, (gsize*)&remainedBuffer);
+ err = g_iconv(cd, (char**)&pSrcText, &srcLen, (char**)&pDestText, &remainedBuffer);
if (err < 0) {
fprintf(stderr, "g_iconv has failed\n");
g_iconv_close(cd);
#ifdef CONVERT_DUMP
fprintf(stderr, "\n########## Dump UCS2 -> UTF8\n");
- MsgConvertDumpTextToHex((unsigned char*)pTempSrcText, srcLen);
+ MsgConvertDumpTextToHex((unsigned char*)pTempSrcText, srcTextLen);
MsgConvertDumpTextToHex((unsigned char*)pTempDestText, utf8Length);
#endif
, tpdu_submit.udl, tpdu_submit.userData);
/* decode time stamp */
- position = DecodeSmsSubmitTpdu(&tpdu_submit, len, (char *)rawdata, 0);
/* time value is located in (start point of user data) -1 */
SmsUtilDecodeTimeStamp( &rawdata[(position-1)], &SCTimeStamp );
TRACE(MSGL_VGSM_INFO, "Event Injector time [%d-%d-%d, %d:%d:%d]\n"