Skip to content

Commit b2d2f9c

Browse files
authored
Update string conversion for SQLITE_TEXT case
1 parent 2e4398b commit b2d2f9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sqlite3_opt_preupdate_hook.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ func (d *SQLitePreUpdateData) row(dest []any, new bool) error {
7878
blobptr := C.sqlite3_value_blob(val)
7979
src = C.GoBytes(blobptr, len)
8080
case C.SQLITE_TEXT:
81+
len := C.sqlite3_value_bytes(val)
8182
cstrptr := unsafe.Pointer(C.sqlite3_value_text(val))
82-
src = C.GoString((*C.char)(cstrptr))
83+
src = C.GoStringN((*C.char)(cstrptr), len)
8384
case C.SQLITE_NULL:
8485
src = nil
8586
}

0 commit comments

Comments
 (0)