lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 228a62f799faba5e5c7181fe78a690b2ec63274c
parent 7c2fb15becd0486152a06a2759f053654273c7c2
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 21 Feb 2000 16:30:20 -0200

details

Diffstat:
Mlua.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lua.c b/lua.c @@ -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 ** See Copyright Notice in lua.h */ @@ -87,10 +87,10 @@ static void print_version (void) { static void assign (char *arg) { - if (strlen(arg) >= 500) + char buffer[500]; + if (strlen(arg) >= sizeof(buffer)) fprintf(stderr, "lua: shell argument too long"); else { - char buffer[500]; char *eq = strchr(arg, '='); lua_pushstring(eq+1); strncpy(buffer, arg, eq-arg);