From 2a81086ec387a9a874900bceed0b0cca2032bdc9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 25 Jan 2016 16:16:19 +0000 Subject: Add lua_sqlite3 unit tests --- src/lua/lua_sqlite3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lua') diff --git a/src/lua/lua_sqlite3.c b/src/lua/lua_sqlite3.c index 34a5a9e19..4442cacab 100644 --- a/src/lua/lua_sqlite3.c +++ b/src/lua/lua_sqlite3.c @@ -136,7 +136,7 @@ lua_sqlite3_bind_statements (lua_State *L, gint start, gint end, gsize slen; gdouble n; - g_assert (start < end && start > 0 && end > 0); + g_assert (start <= end && start > 0 && end > 0); for (i = start; i <= end; i ++) { type = lua_type (L, i); @@ -194,7 +194,7 @@ lua_sqlite3_sql (lua_State *L) if (top > 2) { /* Push additional arguments to sqlite3 */ - lua_sqlite3_bind_statements (L, 2, top, stmt); + lua_sqlite3_bind_statements (L, 3, top, stmt); } rc = sqlite3_step (stmt); @@ -305,7 +305,7 @@ lua_sqlite3_rows (lua_State *L) if (top > 2) { /* Push additional arguments to sqlite3 */ - lua_sqlite3_bind_statements (L, 2, top, stmt); + lua_sqlite3_bind_statements (L, 3, top, stmt); } /* Create C closure */ -- cgit v1.2.3