[td-255] replace wcsncpy with memcpy
This commit is contained in:
parent
fdbd8fe099
commit
3c45dcdee9
|
@ -100,10 +100,9 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32
|
||||||
}
|
}
|
||||||
case TSDB_DATA_TYPE_NCHAR: { // here we get the nchar length from raw binary bits length
|
case TSDB_DATA_TYPE_NCHAR: { // here we get the nchar length from raw binary bits length
|
||||||
size_t lenInwchar = len / TSDB_NCHAR_SIZE;
|
size_t lenInwchar = len / TSDB_NCHAR_SIZE;
|
||||||
|
|
||||||
pVar->wpz = calloc(1, (lenInwchar + 1) * TSDB_NCHAR_SIZE);
|
pVar->wpz = calloc(1, (lenInwchar + 1) * TSDB_NCHAR_SIZE);
|
||||||
|
memcpy(pVar->wpz, pz, lenInwchar * TSDB_NCHAR_SIZE);
|
||||||
wcsncpy(pVar->wpz, (wchar_t *)pz, lenInwchar);
|
|
||||||
pVar->wpz[lenInwchar] = 0;
|
|
||||||
pVar->nLen = (int32_t)len;
|
pVar->nLen = (int32_t)len;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue