diff options
| author | 2025-04-04 15:34:38 +0000 | |
|---|---|---|
| committer | 2025-04-04 17:34:38 +0200 | |
| commit | db4b85715966ee590c6cdff5cc52e592b66e3d17 (patch) | |
| tree | 83642d3afe51fbe279e36a9a6c9069f785a0adeb /vendor/github.com/ncruces/go-sqlite3/value.go | |
| parent | [bugfix] Fix Atkinson Hyperlegible font embedding on Ecks Pee theme. (#3964) (diff) | |
| download | gotosocial-db4b85715966ee590c6cdff5cc52e592b66e3d17.tar.xz | |
[chore] bump ncruces/go-sqlite3 to v0.25.0 (#3966)
Diffstat (limited to 'vendor/github.com/ncruces/go-sqlite3/value.go')
| -rw-r--r-- | vendor/github.com/ncruces/go-sqlite3/value.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vendor/github.com/ncruces/go-sqlite3/value.go b/vendor/github.com/ncruces/go-sqlite3/value.go index a2399fba0..6753027b5 100644 --- a/vendor/github.com/ncruces/go-sqlite3/value.go +++ b/vendor/github.com/ncruces/go-sqlite3/value.go @@ -139,7 +139,7 @@ func (v Value) Blob(buf []byte) []byte { // https://sqlite.org/c3ref/value_blob.html func (v Value) RawText() []byte { ptr := ptr_t(v.c.call("sqlite3_value_text", v.protected())) - return v.rawBytes(ptr) + return v.rawBytes(ptr, 1) } // RawBlob returns the value as a []byte. @@ -149,16 +149,16 @@ func (v Value) RawText() []byte { // https://sqlite.org/c3ref/value_blob.html func (v Value) RawBlob() []byte { ptr := ptr_t(v.c.call("sqlite3_value_blob", v.protected())) - return v.rawBytes(ptr) + return v.rawBytes(ptr, 0) } -func (v Value) rawBytes(ptr ptr_t) []byte { +func (v Value) rawBytes(ptr ptr_t, nul int32) []byte { if ptr == 0 { return nil } n := int32(v.c.call("sqlite3_value_bytes", v.protected())) - return util.View(v.c.mod, ptr, int64(n)) + return util.View(v.c.mod, ptr, int64(n+nul))[:n] } // Pointer gets the pointer associated with this value, |
