summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--liolib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/liolib.c b/liolib.c
index 91086e63..da18b7d6 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.118 2014/03/06 17:12:02 roberto Exp roberto $ 2** $Id: liolib.c,v 2.119 2014/03/13 20:07:18 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -569,15 +569,15 @@ static int f_seek (lua_State *L) {
569 static const char *const modenames[] = {"set", "cur", "end", NULL}; 569 static const char *const modenames[] = {"set", "cur", "end", NULL};
570 FILE *f = tofile(L); 570 FILE *f = tofile(L);
571 int op = luaL_checkoption(L, 2, "cur", modenames); 571 int op = luaL_checkoption(L, 2, "cur", modenames);
572 lua_Number p3 = luaL_optnumber(L, 3, 0); 572 lua_Integer p3 = luaL_optinteger(L, 3, 0);
573 l_seeknum offset = (l_seeknum)p3; 573 l_seeknum offset = (l_seeknum)p3;
574 luaL_argcheck(L, (lua_Number)offset == p3, 3, 574 luaL_argcheck(L, (lua_Integer)offset == p3, 3,
575 "not an integer in proper range"); 575 "not an integer in proper range");
576 op = l_fseek(f, offset, mode[op]); 576 op = l_fseek(f, offset, mode[op]);
577 if (op) 577 if (op)
578 return luaL_fileresult(L, 0, NULL); /* error */ 578 return luaL_fileresult(L, 0, NULL); /* error */
579 else { 579 else {
580 lua_pushnumber(L, (lua_Number)l_ftell(f)); 580 lua_pushinteger(L, (lua_Integer)l_ftell(f));
581 return 1; 581 return 1;
582 } 582 }
583} 583}