diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-02-21 16:30:42 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-02-21 16:30:42 -0200 |
| commit | 228a62f799faba5e5c7181fe78a690b2ec63274c (patch) | |
| tree | dba10409b05b524d8fa88c61832cd7c81afa4aa2 /lua.c | |
| parent | 7c2fb15becd0486152a06a2759f053654273c7c2 (diff) | |
| download | lua-228a62f799faba5e5c7181fe78a690b2ec63274c.tar.gz lua-228a62f799faba5e5c7181fe78a690b2ec63274c.tar.bz2 lua-228a62f799faba5e5c7181fe78a690b2ec63274c.zip | |
details
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); |
