aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lstring.c b/lstring.c
index 588ee546..9802d9a8 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 2.50 2015/06/18 14:20:32 roberto Exp roberto $ 2** $Id: lstring.c,v 2.51 2015/09/08 15:41:05 roberto Exp roberto $
3** String table (keeps all strings handled by Lua) 3** String table (keeps all strings handled by Lua)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -128,7 +128,7 @@ static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) {
128 ts = gco2ts(o); 128 ts = gco2ts(o);
129 ts->hash = h; 129 ts->hash = h;
130 ts->extra = 0; 130 ts->extra = 0;
131 getaddrstr(ts)[l] = '\0'; /* ending 0 */ 131 getstr(ts)[l] = '\0'; /* ending 0 */
132 return ts; 132 return ts;
133} 133}
134 134
@@ -172,7 +172,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) {
172 list = &g->strt.hash[lmod(h, g->strt.size)]; /* recompute with new size */ 172 list = &g->strt.hash[lmod(h, g->strt.size)]; /* recompute with new size */
173 } 173 }
174 ts = createstrobj(L, l, LUA_TSHRSTR, h); 174 ts = createstrobj(L, l, LUA_TSHRSTR, h);
175 memcpy(getaddrstr(ts), str, l * sizeof(char)); 175 memcpy(getstr(ts), str, l * sizeof(char));
176 ts->shrlen = cast_byte(l); 176 ts->shrlen = cast_byte(l);
177 ts->u.hnext = *list; 177 ts->u.hnext = *list;
178 *list = ts; 178 *list = ts;
@@ -192,7 +192,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
192 if (l >= (MAX_SIZE - sizeof(TString))/sizeof(char)) 192 if (l >= (MAX_SIZE - sizeof(TString))/sizeof(char))
193 luaM_toobig(L); 193 luaM_toobig(L);
194 ts = luaS_createlngstrobj(L, l); 194 ts = luaS_createlngstrobj(L, l);
195 memcpy(getaddrstr(ts), str, l * sizeof(char)); 195 memcpy(getstr(ts), str, l * sizeof(char));
196 return ts; 196 return ts;
197 } 197 }
198} 198}