summaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-01 11:56:49 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-01 11:56:49 -0200
commit68587639945aa68844871fdd74a6729b653f523a (patch)
treecc0efe84ea56f5b03d176768a9771b57bcb5c154 /lstring.c
parentb68fb7f62e1475e28a4cb27569e8b659f925e114 (diff)
downloadlua-github-68587639945aa68844871fdd74a6729b653f523a.tar.gz
bug in lua_pushuserdata(L, NULL)
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstring.c b/lstring.c
index ee087e9b..fbc56dd0 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.c,v 1.52 2001/01/26 15:58:50 roberto Exp roberto $
+** $Id: lstring.c,v 1.53 2001/01/29 19:34:02 roberto Exp roberto $
** String table (keeps all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -97,7 +97,7 @@ TString *luaS_newudata (lua_State *L, size_t s, void *udata) {
ts->nexthash = NULL;
ts->len = s;
ts->u.d.tag = 0;
- ts->u.d.value = (udata == NULL) ? uts+1 : udata;
+ ts->u.d.value = (s > 0) ? uts+1 : udata;
/* insert it on table */
newentry(L, &G(L)->udt, ts, lmod(IntPoint(ts->u.d.value), G(L)->udt.size));
return ts;