From 460942180d10a2d9bcea6773dc0a3a87d6bf8a71 Mon Sep 17 00:00:00 2001 From: Alexander Rolley Date: Sat, 23 May 2026 13:11:41 +0200 Subject: Minor changes to documentation. --- src/db/sqlite.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/sqlite.zig b/src/db/sqlite.zig index 87282ac..953df0b 100644 --- a/src/db/sqlite.zig +++ b/src/db/sqlite.zig @@ -56,8 +56,8 @@ pub const Database = struct { /// /// # Panics /// - /// Panics if there exist unfinalised prepared statements, BLOB handlers, - /// and/or unfinished backup objects. + /// Panics in debug mode if there exist unfinalised prepared statements, + /// BLOB handlers, and/or unfinished backup objects. /// /// See https://sqlite.org/c3ref/close.html pub fn deinit(self: *Database) void { -- cgit v1.2.3-70-g09d2 From 20947eafe683ecca39bbb8357c52fdfbb4275217 Mon Sep 17 00:00:00 2001 From: Alexander Rolley Date: Sat, 23 May 2026 13:13:09 +0200 Subject: Make length conversion safety-check for illegal behaviour instead of silently failing. --- src/db/sqlite.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/db/sqlite.zig b/src/db/sqlite.zig index 953df0b..b1a05bd 100644 --- a/src/db/sqlite.zig +++ b/src/db/sqlite.zig @@ -73,9 +73,7 @@ pub const Database = struct { var handle: ?*sqlite.sqlite3_stmt = null; var unused: [*c]const u8 = null; - const length: c_int = @truncate(@as(isize, @intCast(statement.len))); - - const result: Result = .from(sqlite.sqlite3_prepare_v2(self.handle, statement.ptr, length, &handle, &unused)); + const result: Result = .from(sqlite.sqlite3_prepare_v2(self.handle, statement.ptr, @intCast(statement.len), &handle, &unused)); return if (result.isOk()) .{ .handle = handle.? } else result.toError(self.handle); } -- cgit v1.2.3-70-g09d2 From 6b0c1bbdcec1d7eff7854242c98a6f4db5588f66 Mon Sep 17 00:00:00 2001 From: Alexander Rolley Date: Sun, 24 May 2026 12:24:34 +0200 Subject: Revert "Minor changes to documentation." This reverts commit 460942180d10a2d9bcea6773dc0a3a87d6bf8a71. --- src/db/sqlite.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/db/sqlite.zig b/src/db/sqlite.zig index b1a05bd..f2fae69 100644 --- a/src/db/sqlite.zig +++ b/src/db/sqlite.zig @@ -56,8 +56,8 @@ pub const Database = struct { /// /// # Panics /// - /// Panics in debug mode if there exist unfinalised prepared statements, - /// BLOB handlers, and/or unfinished backup objects. + /// Panics if there exist unfinalised prepared statements, BLOB handlers, + /// and/or unfinished backup objects. /// /// See https://sqlite.org/c3ref/close.html pub fn deinit(self: *Database) void { -- cgit v1.2.3-70-g09d2