Fix off-by-one error in err_chunkid().

master
Mike Pall 2009-12-14 02:28:22 +01:00
parent ef885f476e
commit 547508f36f
1 changed files with 1 additions and 1 deletions

View File

@ -204,7 +204,7 @@ static void err_chunkid(char *out, const char *src)
strcpy(out, src);
} else { /* out = [string "string"] */
size_t len; /* Length, up to first control char. */
for (len = 0; len < LUA_IDSIZE-11; len++)
for (len = 0; len < LUA_IDSIZE-12; len++)
if (((const unsigned char *)src)[len] < ' ') break;
strcpy(out, "[string \""); out += 9;
if (src[len] != '\0') { /* must truncate? */