Browse Source

make sure there is no mem problems, using %.ns instead of %s for luaV_error.

v5-2
Roberto Ierusalimschy 27 years ago
parent
commit
6153200bc2
  1. 4
      lapi.c
  2. 4
      liolib.c
  3. 4
      lmathlib.c
  4. 4
      ltm.c

4
lapi.c

@ -1,5 +1,5 @@
/* /*
** $Id: lapi.c,v 1.4 1997/11/04 15:27:53 roberto Exp roberto $ ** $Id: lapi.c,v 1.5 1997/11/19 17:29:23 roberto Exp roberto $
** Lua API ** Lua API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -389,7 +389,7 @@ void lua_settag (int tag)
(L->stack.top-1)->value.ts->u.d.tag = tag; (L->stack.top-1)->value.ts->u.d.tag = tag;
break; break;
default: default:
luaL_verror("cannot change the tag of a %s", luaL_verror("cannot change the tag of a %.20s",
luaO_typenames[-ttype((L->stack.top-1))]); luaO_typenames[-ttype((L->stack.top-1))]);
} }
L->stack.top--; L->stack.top--;

4
liolib.c

@ -1,5 +1,5 @@
/* /*
** $Id: liolib.c,v 1.4 1997/11/04 15:27:53 roberto Exp roberto $ ** $Id: liolib.c,v 1.5 1997/11/19 17:29:23 roberto Exp roberto $
** Standard I/O (and system) library ** Standard I/O (and system) library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -83,7 +83,7 @@ static FILE *getfile (char *name)
{ {
lua_Object f = lua_getglobal(name); lua_Object f = lua_getglobal(name);
if (!ishandler(f)) if (!ishandler(f))
luaL_verror("global variable %s is not a file handle", name); luaL_verror("global variable %.50s is not a file handle", name);
return lua_getuserdata(f); return lua_getuserdata(f);
} }

4
lmathlib.c

@ -1,5 +1,5 @@
/* /*
** $Id: lmathlib.c,v 1.3 1997/11/03 21:11:44 roberto Exp roberto $ ** $Id: lmathlib.c,v 1.4 1997/11/04 15:27:53 roberto Exp roberto $
** Lua standard mathematical library ** Lua standard mathematical library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -30,7 +30,7 @@ static double torad (void)
case 'r' : return 1.0; case 'r' : return 1.0;
case 'g' : return PI/50.0; case 'g' : return PI/50.0;
default: default:
luaL_verror("invalid _TRIGMODE (`%s')", s); luaL_verror("invalid _TRIGMODE (`%.50s')", s);
return 0; /* to avoid warnings */ return 0; /* to avoid warnings */
} }
} }

4
ltm.c

@ -1,5 +1,5 @@
/* /*
** $Id: ltm.c,v 1.7 1997/11/10 17:47:01 roberto Exp roberto $ ** $Id: ltm.c,v 1.8 1997/11/19 17:29:23 roberto Exp roberto $
** Tag methods ** Tag methods
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -131,7 +131,7 @@ void luaT_settagmethod (int t, char *event, TObject *func)
int e = luaI_checkevent(event, luaT_eventname); int e = luaI_checkevent(event, luaT_eventname);
checktag(t); checktag(t);
if (!validevent(t, e)) if (!validevent(t, e))
luaL_verror("settagmethod: cannot change internal method `%s' for tag %d", luaL_verror("settagmethod: cannot change internal method `%.20s' for tag %d",
luaT_eventname[e], t); luaT_eventname[e], t);
*func = *luaT_getim(t,e); *func = *luaT_getim(t,e);
*luaT_getim(t, e) = temp; *luaT_getim(t, e) = temp;

Loading…
Cancel
Save