Skip to content

Commit

Permalink
Fix optional argument handling in table.concat().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pall committed May 8, 2013
1 parent c5d7666 commit b030788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ LJLIB_CF(table_concat)
GCstr *sep = lj_lib_optstr(L, 2);
MSize seplen = sep ? sep->len : 0;
int32_t i = lj_lib_optint(L, 3, 1);
int32_t e = L->base+3 < L->top ? lj_lib_checkint(L, 4) :
(int32_t)lj_tab_len(t);
int32_t e = (L->base+3 < L->top && !tvisnil(L->base+3)) ?
lj_lib_checkint(L, 4) : (int32_t)lj_tab_len(t);
luaL_buffinit(L, &b);
if (i <= e) {
for (;;) {
Expand Down

0 comments on commit b030788

Please sign in to comment.