Commit 6f574615 authored by gwenn's avatar gwenn

Misc.

parent c889fbc9
......@@ -237,7 +237,7 @@ func (c *Context) Blob(i int) (value []byte) {
p := C.my_value_blob(c.argv, C.int(i))
if p != nil {
n := C.my_value_bytes(c.argv, C.int(i))
value = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
value = (*[1 << 30]byte)(unsafe.Pointer(p))[:n]
}
return
}
......
......@@ -675,7 +675,7 @@ func (s *Stmt) ScanValue(index int) (value interface{}) {
case Blob:
p := C.sqlite3_column_blob(s.stmt, C.int(index))
n := C.sqlite3_column_bytes(s.stmt, C.int(index))
value = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
value = (*[1 << 30]byte)(unsafe.Pointer(p))[:n]
default:
panic("The column type is not one of SQLITE_INTEGER, SQLITE_FLOAT, SQLITE_TEXT, SQLITE_BLOB, or SQLITE_NULL")
}
......@@ -792,7 +792,7 @@ func (s *Stmt) ScanBlob(index int) (value []byte, isNull bool) {
isNull = true
} else {
n := C.sqlite3_column_bytes(s.stmt, C.int(index))
value = (*[1 << 30]byte)(unsafe.Pointer(p))[0:n]
value = (*[1 << 30]byte)(unsafe.Pointer(p))[:n]
}
return
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment