From 19a1e19ae1014d8afbfe4d8f49eb37e2f7df8f35 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 6 Apr 1997 11:14:27 -0300 Subject: detail: better way to put a "..." in message. --- inout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inout.c b/inout.c index 25390926..8332c257 100644 --- a/inout.c +++ b/inout.c @@ -5,7 +5,7 @@ ** Also provides some predefined lua functions. */ -char *rcs_inout="$Id: inout.c,v 2.55 1997/04/04 22:24:51 roberto Exp roberto $"; +char *rcs_inout="$Id: inout.c,v 2.56 1997/04/06 14:08:08 roberto Exp roberto $"; #include #include @@ -95,8 +95,8 @@ void lua_openstring (char *s) char buff[SIZE_PREF+25]; lua_setinput(stringinput); st = s; - sprintf(buff, "(dostring) >> %.20s", s); - if (strlen(s) > SIZE_PREF) strcat(buff, "..."); + sprintf(buff, "(dostring) >> %.20s%s", s, + (strlen(s) > SIZE_PREF) ? "..." : ""); lua_parsedfile = luaI_createfixedstring(buff)->str; } -- cgit v1.2.3-55-g6feb