diff options
-rw-r--r-- | lobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 2.41 2010/10/28 15:39:03 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.42 2010/10/29 11:13:14 roberto Exp roberto $ |
3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -226,7 +226,7 @@ void luaO_chunkid (char *out, const char *source, size_t bufflen) { | |||
226 | else { /* string; format as [string "source"] */ | 226 | else { /* string; format as [string "source"] */ |
227 | const char *nl = strchr(source, '\n'); /* find first new line (if any) */ | 227 | const char *nl = strchr(source, '\n'); /* find first new line (if any) */ |
228 | addstr(out, PRE, LL(PRE)); /* add prefix */ | 228 | addstr(out, PRE, LL(PRE)); /* add prefix */ |
229 | bufflen -= LL(PRE RETS POS); /* save space for prefix+suffix */ | 229 | bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ |
230 | if (l < bufflen && nl == NULL) { /* small one-line source? */ | 230 | if (l < bufflen && nl == NULL) { /* small one-line source? */ |
231 | addstr(out, source, l); /* keep it */ | 231 | addstr(out, source, l); /* keep it */ |
232 | } | 232 | } |