This commit is contained in:
Roberto Ierusalimschy 2000-02-21 16:30:42 -02:00
parent 7c2fb15bec
commit 228a62f799
1 changed files with 3 additions and 3 deletions

6
lua.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.c,v 1.31 1999/12/30 18:29:46 roberto Exp roberto $ ** $Id: lua.c,v 1.32 2000/01/19 16:50:14 roberto Exp roberto $
** Lua stand-alone interpreter ** Lua stand-alone interpreter
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -87,10 +87,10 @@ static void print_version (void) {
static void assign (char *arg) { static void assign (char *arg) {
if (strlen(arg) >= 500) char buffer[500];
if (strlen(arg) >= sizeof(buffer))
fprintf(stderr, "lua: shell argument too long"); fprintf(stderr, "lua: shell argument too long");
else { else {
char buffer[500];
char *eq = strchr(arg, '='); char *eq = strchr(arg, '=');
lua_pushstring(eq+1); lua_pushstring(eq+1);
strncpy(buffer, arg, eq-arg); strncpy(buffer, arg, eq-arg);