aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2016-02-25 16:42:55 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2016-02-25 16:42:55 -0300
commitc3e9b14d24afe14b2fc59c83d134430be5568769 (patch)
tree96417f62f8e225539db5e8d5a2f2a2a27bf63b7a /lstrlib.c
parent7d6b78ee7934a00fbc69ab04ba36aa420db8ba76 (diff)
downloadlua-c3e9b14d24afe14b2fc59c83d134430be5568769.tar.gz
lua-c3e9b14d24afe14b2fc59c83d134430be5568769.tar.bz2
lua-c3e9b14d24afe14b2fc59c83d134430be5568769.zip
'\0' is a control character, no need to check it explicitly
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index a43c4a82..2f9dbf0f 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -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));