lua

A copy of the Lua development repository
Log | Files | Refs | README

commit b074306267b70015d770cb33c78dcf6cfe53fb45
parent 3c75b755167d899c9b65a7e5a622b8e93ce52ed6
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 11 Oct 1995 17:50:37 -0300

bug. "fgets" reads n-1 chars.

Diffstat:
Miolib.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iolib.c b/iolib.c @@ -3,7 +3,7 @@ ** Input/output library to LUA */ -char *rcs_iolib="$Id: iolib.c,v 1.21 1995/02/06 19:36:13 roberto Exp roberto $"; +char *rcs_iolib="$Id: iolib.c,v 1.22 1995/10/04 13:53:10 roberto Exp roberto $"; #include <stdio.h> #include <ctype.h> @@ -251,7 +251,7 @@ static void io_read (void) char f[80]; char s[256]; sprintf (f, "%%%ds", m); - if (fgets (s, m, in) == NULL) + if (fgets (s, m+1, in) == NULL) { lua_pushnil(); return;