diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-02-25 16:42:55 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2016-02-25 16:42:55 -0300 |
| commit | c3e9b14d24afe14b2fc59c83d134430be5568769 (patch) | |
| tree | 96417f62f8e225539db5e8d5a2f2a2a27bf63b7a | |
| parent | 7d6b78ee7934a00fbc69ab04ba36aa420db8ba76 (diff) | |
| download | lua-c3e9b14d24afe14b2fc59c83d134430be5568769.tar.gz lua-c3e9b14d24afe14b2fc59c83d134430be5568769.tar.bz2 lua-c3e9b14d24afe14b2fc59c83d134430be5568769.zip | |
'\0' is a control character, no need to check it explicitly
| -rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstrlib.c,v 1.238 2015/11/23 11:31:21 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.239 2015/11/25 16:28:17 roberto Exp roberto $ |
| 3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -931,7 +931,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { | |||
| 931 | luaL_addchar(b, '\\'); | 931 | luaL_addchar(b, '\\'); |
| 932 | luaL_addchar(b, *s); | 932 | luaL_addchar(b, *s); |
| 933 | } | 933 | } |
| 934 | else if (*s == '\0' || iscntrl(uchar(*s))) { | 934 | else if (iscntrl(uchar(*s))) { |
| 935 | char buff[10]; | 935 | char buff[10]; |
| 936 | if (!isdigit(uchar(*(s+1)))) | 936 | if (!isdigit(uchar(*(s+1)))) |
| 937 | l_sprintf(buff, sizeof(buff), "\\%d", (int)uchar(*s)); | 937 | l_sprintf(buff, sizeof(buff), "\\%d", (int)uchar(*s)); |
