diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-09 11:50:08 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-12-09 11:50:08 -0200 |
| commit | 80b3d28f4a9e518bf40b35f786199919180bfcd4 (patch) | |
| tree | e25a410ba61883244207e25b16a853991b417ebb /ldo.c | |
| parent | 69d97712ecfcd06aa4edb7374b262131210d0bbc (diff) | |
| download | lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.tar.gz lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.tar.bz2 lua-80b3d28f4a9e518bf40b35f786199919180bfcd4.zip | |
details (mainly error messages)
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.12 1997/11/26 20:44:52 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.13 1997/11/27 18:25:14 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -381,6 +381,7 @@ int lua_dofile (char *filename) | |||
| 381 | 381 | ||
| 382 | 382 | ||
| 383 | #define SIZE_PREF 20 /* size of string prefix to appear in error messages */ | 383 | #define SIZE_PREF 20 /* size of string prefix to appear in error messages */ |
| 384 | #define SSIZE_PREF "20" | ||
| 384 | 385 | ||
| 385 | 386 | ||
| 386 | int lua_dostring (char *str) | 387 | int lua_dostring (char *str) |
| @@ -390,7 +391,7 @@ int lua_dostring (char *str) | |||
| 390 | char *temp; | 391 | char *temp; |
| 391 | ZIO z; | 392 | ZIO z; |
| 392 | if (str == NULL) return 1; | 393 | if (str == NULL) return 1; |
| 393 | sprintf(buff, "(dostring) >> %.20s", str); | 394 | sprintf(buff, "(dostring) >> %." SSIZE_PREF "s", str); |
| 394 | temp = strchr(buff, '\n'); | 395 | temp = strchr(buff, '\n'); |
| 395 | if (temp) *temp = 0; /* end string after first line */ | 396 | if (temp) *temp = 0; /* end string after first line */ |
| 396 | luaZ_sopen(&z, str); | 397 | luaZ_sopen(&z, str); |
