aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lua_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua_interface.c')
-rw-r--r--src/lua_interface.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 7752dcc5..c049fed8 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -1027,6 +1027,7 @@ static int l_cf_buffer_text_range(lua_State *lua) {
struct Sci_TextRange tr;
tr.chrg.cpMin = luaL_checkinteger(lua, 2);
tr.chrg.cpMax = luaL_checkinteger(lua, 3);
+ luaL_argcheck(lua, tr.chrg.cpMin < tr.chrg.cpMax, 3, "start > end");
int length = tr.chrg.cpMax - tr.chrg.cpMin;
char *text = malloc(length + 1);
tr.lpstrText = text;