diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-09 18:29:33 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-02-09 18:29:33 -0200 |
| commit | 03d8a9bf0d8d9c149c0c2c0ae63732a8bfa512fd (patch) | |
| tree | 7cc200dbbf6ac892ef2607683c50ae28f3f86fab /ltests.c | |
| parent | d2e340f467a46017fa3526074c1756124e569880 (diff) | |
| download | lua-03d8a9bf0d8d9c149c0c2c0ae63732a8bfa512fd.tar.gz lua-03d8a9bf0d8d9c149c0c2c0ae63732a8bfa512fd.tar.bz2 lua-03d8a9bf0d8d9c149c0c2c0ae63732a8bfa512fd.zip | |
details
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 6 |
1 files changed, 4 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltests.c,v 1.65 2001/02/09 19:53:16 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.66 2001/02/09 20:22:29 roberto Exp roberto $ |
| 3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -356,7 +356,9 @@ static int newuserdata (lua_State *L) { | |||
| 356 | return 2; | 356 | return 2; |
| 357 | } | 357 | } |
| 358 | else { | 358 | else { |
| 359 | lua_newuserdata(L, luaL_check_int(L, 1)); | 359 | size_t size = luaL_check_int(L, 1); |
| 360 | char *p = (char *)lua_newuserdata(L, size); | ||
| 361 | while (size--) *p++ = '\0'; | ||
| 360 | return 1; | 362 | return 1; |
| 361 | } | 363 | } |
| 362 | } | 364 | } |
