From 658ea8752b979102627e2fede7b7ddfbb67ba6c9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 4 May 2010 14:20:33 -0300 Subject: no need to handle '\0' differently from other control chars in format '%q' --- lstrlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lstrlib.c b/lstrlib.c index f5126d74..98e2a577 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.150 2010/04/12 12:00:50 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.151 2010/04/12 16:13:02 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -756,7 +756,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { } else if (*s == '\0' || iscntrl(uchar(*s))) { char buff[10]; - if (*s != '\0' && !isdigit(uchar(*(s+1)))) + if (!isdigit(uchar(*(s+1)))) sprintf(buff, "\\%d", uchar(*s)); else sprintf(buff, "\\%03d", uchar(*s)); -- cgit v1.2.3-55-g6feb