From: Diego Martínez Date: Sun, 4 Jan 2015 23:10:25 +0000 (-0300) Subject: Fix off-by-one error in `string:split` implementation. X-Git-Tag: 0.4.12~142 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=00bca11f5988cfe7ce019c15c056ae258c254023;p=oweals%2Fminetest.git Fix off-by-one error in `string:split` implementation. --- diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua index 2ee990e5c..a86631e1d 100644 --- a/builtin/common/misc_helpers.lua +++ b/builtin/common/misc_helpers.lua @@ -178,7 +178,7 @@ function string.split(str, delim, include_empty, max_splits, sep_is_pattern) table_insert(items, s) end pos = npe + 1 - until (max_splits == 0) or (pos > len) + until (max_splits == 0) or (pos > (len + 1)) return items end