mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
ui/app: (android) fix length of C string copy
The data dir string is returned to Go as a byte array of the UTF-8 encoded string, but it is not NUL terminated. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -9,8 +9,8 @@ import "C"
|
||||
var dataDir func() (string, error)
|
||||
|
||||
//export setDataDir
|
||||
func setDataDir(cdir *C.char) {
|
||||
dir := C.GoString(cdir)
|
||||
func setDataDir(cdir *C.char, len C.int) {
|
||||
dir := C.GoStringN(cdir, len)
|
||||
dataDir = func() (string, error) {
|
||||
return dir, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user