summaryrefslogtreecommitdiffstats
path: root/lualib/lua_magic/heuristics.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_magic/heuristics.lua')
-rw-r--r--lualib/lua_magic/heuristics.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua
index 66e186906..d977596ca 100644
--- a/lualib/lua_magic/heuristics.lua
+++ b/lualib/lua_magic/heuristics.lua
@@ -333,7 +333,7 @@ exports.text_part_heuristic = function(part, log_obj, _)
local b = bytes[idx]
local n8bit = 0
- while b >= 127 and n8bit < remain do
+ while b >= 127 and idx < remain do
-- utf8 part
if bit.band(b, 0xe0) == 0xc0 and remain > 1 and
bit.band(bytes[idx + 1], 0xc0) == 0x80 then