aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_cconv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lj_cconv.c b/src/lj_cconv.c
index d4578f88..1e6df8d8 100644
--- a/src/lj_cconv.c
+++ b/src/lj_cconv.c
@@ -545,10 +545,8 @@ void lj_cconv_ct_tv(CTState *cts, CType *d,
545 CTSize sz = str->len+1; 545 CTSize sz = str->len+1;
546 if (!ctype_isinteger(dc->info) || dc->size != 1) 546 if (!ctype_isinteger(dc->info) || dc->size != 1)
547 goto err_conv; 547 goto err_conv;
548 if (d->size != 0 && d->size < sz) { 548 if (d->size != 0 && d->size < sz)
549 sz = d->size-1; 549 sz = d->size;
550 dp[sz] = '\0';
551 }
552 memcpy(dp, strdata(str), sz); 550 memcpy(dp, strdata(str), sz);
553 return; 551 return;
554 } else { /* Otherwise pass it as a const char[]. */ 552 } else { /* Otherwise pass it as a const char[]. */