From d3651c1d88b65f3c9947d1f4f443d00f5340b28b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 8 Feb 2002 20:41:09 -0200 Subject: [PATCH] `getstr' now gives const char * --- lstring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lstring.c b/lstring.c index c83a4d5e..4643f214 100644 --- a/lstring.c +++ b/lstring.c @@ -53,8 +53,8 @@ static TString *newlstr (lua_State *L, const char *str, size_t l, lu_hash h) { ts->tsv.len = l; ts->tsv.hash = h; ts->tsv.marked = 0; - memcpy(getstr(ts), str, l*sizeof(char)); - getstr(ts)[l] = '\0'; /* ending 0 */ + memcpy(ts+1, str, l*sizeof(char)); + ((char *)(ts+1))[l] = '\0'; /* ending 0 */ tb = &G(L)->strt; h = lmod(h, tb->size); ts->tsv.nexthash = tb->hash[h]; /* chain new entry */