diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LuaHandle.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc index 72602b3..88dccc5 100644 --- a/lib/LuaHandle.cc +++ b/lib/LuaHandle.cc @@ -275,7 +275,7 @@ int sLuaHandle::readfile(lua_State * __L) { return 1; } -#define MAXCHUNKSIZE 65536L +#define MAXCHUNKSIZE 65536 int sLuaHandle::adler32(lua_State * __L) { Lua * L = Lua::find(__L); @@ -298,7 +298,7 @@ int sLuaHandle::adler32(lua_State * __L) { Uint32 adler = ::adler32(0L, Z_NULL, 0); while (tg > 0) { - blk = MIN(MAXCHUNKSIZE, tg); + blk = tg > MAXCHUNKSIZE ? MAXCHUNKSIZE : tg h->read(buf, blk); tg -= blk; adler = ::adler32(adler, buf, blk); @@ -331,7 +331,7 @@ int sLuaHandle::crc32(lua_State * __L) { Uint32 crc = ::crc32(0L, Z_NULL, 0); while (tg > 0) { - blk = MIN(MAXCHUNKSIZE, tg); + blk = tg > MAXCHUNKSIZE ? MAXCHUNKSIZE : tg h->read(buf, blk); tg -= blk; crc = ::crc32(crc, buf, blk); |