mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
FFI: Don't force zero terminator on string to array conversion.
This commit is contained in:
parent
96ef87bdfd
commit
705f593ffc
@ -545,10 +545,8 @@ void lj_cconv_ct_tv(CTState *cts, CType *d,
|
||||
CTSize sz = str->len+1;
|
||||
if (!ctype_isinteger(dc->info) || dc->size != 1)
|
||||
goto err_conv;
|
||||
if (d->size != 0 && d->size < sz) {
|
||||
sz = d->size-1;
|
||||
dp[sz] = '\0';
|
||||
}
|
||||
if (d->size != 0 && d->size < sz)
|
||||
sz = d->size;
|
||||
memcpy(dp, strdata(str), sz);
|
||||
return;
|
||||
} else { /* Otherwise pass it as a const char[]. */
|
||||
|
Loading…
Reference in New Issue
Block a user