mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix off-by-one error in err_chunkid().
This commit is contained in:
parent
ef885f476e
commit
547508f36f
@ -204,7 +204,7 @@ static void err_chunkid(char *out, const char *src)
|
|||||||
strcpy(out, src);
|
strcpy(out, src);
|
||||||
} else { /* out = [string "string"] */
|
} else { /* out = [string "string"] */
|
||||||
size_t len; /* Length, up to first control char. */
|
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;
|
if (((const unsigned char *)src)[len] < ' ') break;
|
||||||
strcpy(out, "[string \""); out += 9;
|
strcpy(out, "[string \""); out += 9;
|
||||||
if (src[len] != '\0') { /* must truncate? */
|
if (src[len] != '\0') { /* must truncate? */
|
||||||
|
Loading…
Reference in New Issue
Block a user