From 78a231014be3a76e9e546b31a5e6fa2a9a7b720e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 25 Feb 2022 19:59:47 -0500 Subject: external dependency update, housekeeping, routine --- src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ext_depends/d2sqlite3/source') diff --git a/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d b/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d index 8cf6a38..3b262ab 100644 --- a/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d +++ b/src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d @@ -88,14 +88,15 @@ package(d2sqlite3): this(Database db, string sql) { sqlite3_stmt* handle; + enforce(sql.length <= int.max, "Length of SQL statement exceeds `int.max`"); version (_UnlockNotify) { - auto result = sqlite3_blocking_prepare_v2(db, sql.toStringz, sql.length.to!int, + auto result = sqlite3_blocking_prepare_v2(db, sql.ptr, cast(int) sql.length, &handle, null); } else { - auto result = sqlite3_prepare_v2(db.handle(), sql.toStringz, sql.length.to!int, + auto result = sqlite3_prepare_v2(db.handle(), sql.ptr, cast(int) sql.length, &handle, null); } enforce(result == SQLITE_OK, new SqliteException(errmsg(db.handle()), result, sql)); -- cgit v1.2.3