mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55: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:
+2
-1
@@ -106,7 +106,8 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
if (dir == NULL) {
|
||||
return -1;
|
||||
}
|
||||
setDataDir((char *)dir);
|
||||
jint n = (*env)->GetArrayLength(env, dirArr);
|
||||
setDataDir((char *)dir, n);
|
||||
(*env)->ReleaseByteArrayElements(env, dirArr, dir, JNI_ABORT);
|
||||
|
||||
return JNI_VERSION_1_6;
|
||||
|
||||
Reference in New Issue
Block a user