aboutsummaryrefslogtreecommitdiff
path: root/src/lib_ffi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_ffi.c')
-rw-r--r--src/lib_ffi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib_ffi.c b/src/lib_ffi.c
index 3310b205..6203481b 100644
--- a/src/lib_ffi.c
+++ b/src/lib_ffi.c
@@ -658,7 +658,7 @@ LJLIB_CF(ffi_string) LJLIB_REC(.)
658 TValue *o = lj_lib_checkany(L, 1); 658 TValue *o = lj_lib_checkany(L, 1);
659 const char *p; 659 const char *p;
660 size_t len; 660 size_t len;
661 if (o+1 < L->top) { 661 if (o+1 < L->top && !tvisnil(o+1)) {
662 len = (size_t)ffi_checkint(L, 2); 662 len = (size_t)ffi_checkint(L, 2);
663 lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, o, 663 lj_cconv_ct_tv(cts, ctype_get(cts, CTID_P_CVOID), (uint8_t *)&p, o,
664 CCF_ARG(1)); 664 CCF_ARG(1));