db.sqlite: fix get_text trimming data after (including) first 0 character (#25040)

This commit is contained in:
D4MI4NX 2025-08-05 07:54:48 +02:00 committed by GitHub
parent 8cd7a4f136
commit 13ba08fba2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -122,6 +122,8 @@ fn C.sqlite3_column_count(&C.sqlite3_stmt) int
fn C.sqlite3_column_type(&C.sqlite3_stmt, int) int
fn C.sqlite3_column_bytes(&C.sqlite3_stmt, int) int
//
fn C.sqlite3_errstr(int) &char

View file

@ -74,7 +74,8 @@ fn (stmt &Stmt) get_text(idx int) ?string {
if b == &char(unsafe { nil }) {
return ''
}
return unsafe { b.vstring() }
l := C.sqlite3_column_bytes(stmt.stmt, idx)
return unsafe { b.vstring_with_len(l) }
}
}