Browse Source

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

Roberto Ierusalimschy 28 years ago
parent
commit
6153200bc2
4 changed files with 8 additions and 8 deletions
  1. 2 2
      lapi.c
  2. 2 2
      liolib.c
  3. 2 2
      lmathlib.c
  4. 2 2
      ltm.c

+ 2 - 2
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
 ** 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;
       break;
     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))]);
   }
   L->stack.top--;

+ 2 - 2
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
 ** See Copyright Notice in lua.h
 */
@@ -83,7 +83,7 @@ static FILE *getfile (char *name)
 {
   lua_Object f = lua_getglobal(name);
   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);
 }
 

+ 2 - 2
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
 ** See Copyright Notice in lua.h
 */
@@ -30,7 +30,7 @@ static double torad (void)
     case 'r' : return 1.0;
     case 'g' : return PI/50.0;
     default:
-      luaL_verror("invalid _TRIGMODE (`%s')", s);
+      luaL_verror("invalid _TRIGMODE (`%.50s')", s);
       return 0;  /* to avoid warnings */
   }
 }

+ 2 - 2
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
 ** 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);
   checktag(t);
   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);
   *func = *luaT_getim(t,e);
   *luaT_getim(t, e) = temp;