From 56d45378796b881b638671655164a16bb8ad8a57 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 10 Oct 2014 19:23:04 -0300 Subject: '$c' in 'lua_pushfstring' prints non-printable characters with their codes --- llex.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llex.c') diff --git a/llex.c b/llex.c index 66a3e3c4..91de0ad8 100644 --- a/llex.c +++ b/llex.c @@ -1,5 +1,5 @@ /* -** $Id: llex.c,v 2.80 2014/07/18 13:36:14 roberto Exp roberto $ +** $Id: llex.c,v 2.81 2014/10/01 11:52:33 roberto Exp roberto $ ** Lexical Analyzer ** See Copyright Notice in lua.h */ @@ -78,9 +78,8 @@ void luaX_init (lua_State *L) { const char *luaX_token2str (LexState *ls, int token) { if (token < FIRST_RESERVED) { /* single-byte symbols? */ - lua_assert(token == cast(unsigned char, token)); - return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : - luaO_pushfstring(ls->L, "char(%d)", token); + lua_assert(token == cast_uchar(token)); + return luaO_pushfstring(ls->L, LUA_QL("%c"), token); } else { const char *s = luaX_tokens[token - FIRST_RESERVED]; -- cgit v1.2.3-55-g6feb