From d08d237a49ff3cb961012b1de374914af6da3000 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 18 Feb 2010 17:37:57 -0200 Subject: detail: in loadfile read function, no need to return NULL on EOF; size ==0 is enough to signal EOF. --- lauxlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lauxlib.c b/lauxlib.c index 47781c36..8e49c311 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.199 2010/02/18 19:18:41 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.200 2010/02/18 19:32:41 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -516,7 +516,7 @@ static const char *getF (lua_State *L, void *ud, size_t *size) { if (feof(lf->f)) return NULL; *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); } - return (*size > 0) ? lf->buff : NULL; + return lf->buff; } -- cgit v1.2.3-55-g6feb