diff options
Diffstat (limited to 'lua.c')
| -rw-r--r-- | lua.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.c,v 1.31 1999/12/30 18:29:46 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.32 2000/01/19 16:50:14 roberto Exp roberto $ |
| 3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -87,10 +87,10 @@ static void print_version (void) { | |||
| 87 | 87 | ||
| 88 | 88 | ||
| 89 | static void assign (char *arg) { | 89 | static void assign (char *arg) { |
| 90 | if (strlen(arg) >= 500) | 90 | char buffer[500]; |
| 91 | if (strlen(arg) >= sizeof(buffer)) | ||
| 91 | fprintf(stderr, "lua: shell argument too long"); | 92 | fprintf(stderr, "lua: shell argument too long"); |
| 92 | else { | 93 | else { |
| 93 | char buffer[500]; | ||
| 94 | char *eq = strchr(arg, '='); | 94 | char *eq = strchr(arg, '='); |
| 95 | lua_pushstring(eq+1); | 95 | lua_pushstring(eq+1); |
| 96 | strncpy(buffer, arg, eq-arg); | 96 | strncpy(buffer, arg, eq-arg); |
