summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/hosted/keyboard.c6
-rw-r--r--apps/hosted/yesno.c2
2 files changed, 3 insertions, 5 deletions
diff --git a/apps/hosted/keyboard.c b/apps/hosted/keyboard.c
index 1993164ade..2b77825af0 100644
--- a/apps/hosted/keyboard.c
+++ b/apps/hosted/keyboard.c
@@ -24,6 +24,7 @@
24#include <jni.h> 24#include <jni.h>
25#include <stdbool.h> 25#include <stdbool.h>
26#include <stdio.h> 26#include <stdio.h>
27#include <string.h>
27#include <system.h> 28#include <system.h>
28 29
29extern JNIEnv *env_ptr; 30extern JNIEnv *env_ptr;
@@ -75,13 +76,12 @@ int kbd_input(char* text, int buflen)
75 kbd_result); 76 kbd_result);
76 } while (!ret); 77 } while (!ret);
77 78
78 e->ReleaseStringUTFChars(env_ptr, str, NULL);
79 retchars = e->GetStringUTFChars(env_ptr, ret, 0); 79 retchars = e->GetStringUTFChars(env_ptr, ret, 0);
80 if (retchars[0]) 80 if (retchars[0])
81 snprintf(text, buflen, retchars); 81 strncpy(text, retchars, buflen);
82 e->ReleaseStringUTFChars(env_ptr, ret, retchars); 82 e->ReleaseStringUTFChars(env_ptr, ret, retchars);
83 83
84 return retchars[0]?0:1; /* return 0 on success */ 84 return text[0] ? 0 : 1; /* return 0 on success */
85} 85}
86 86
87int load_kbd(unsigned char* filename) 87int load_kbd(unsigned char* filename)
diff --git a/apps/hosted/yesno.c b/apps/hosted/yesno.c
index 1e05e193f7..9858e66438 100644
--- a/apps/hosted/yesno.c
+++ b/apps/hosted/yesno.c
@@ -95,8 +95,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
95 jboolean ret; 95 jboolean ret;
96 96
97 e->CallVoidMethod(env_ptr, RockboxYesno_instance, yesno_func, message); 97 e->CallVoidMethod(env_ptr, RockboxYesno_instance, yesno_func, message);
98 e->ReleaseStringUTFChars(env_ptr, message, NULL);
99
100 98
101 do { 99 do {
102 sleep(HZ/10); 100 sleep(HZ/10);