summaryrefslogtreecommitdiff
path: root/apps/hosted/android/keyboard.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2022-11-14 11:32:34 -0500
committerWilliam Wilgus <me.theuser@yahoo.com>2022-11-14 23:56:16 -0500
commitf6c719d7ec71cc7771c46d3daa390924a3871ba3 (patch)
treee6209f23565db01809f75067247e667963092ff6 /apps/hosted/android/keyboard.c
parentb25a9d8f99b75570d18ea64602de7fe48da612d6 (diff)
downloadrockbox-f6c719d7ec71cc7771c46d3daa390924a3871ba3.tar.gz
rockbox-f6c719d7ec71cc7771c46d3daa390924a3871ba3.zip
replace strlcpy with strmemccpy
replace applicable calls to strlcpy with calls to strmemccpy which null terminates on truncation in theory the strmemccpy calls should be slightly faster since they don't traverse the rest of the source string on truncation but I seriously doubt there is too much of that going on in the code base Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
Diffstat (limited to 'apps/hosted/android/keyboard.c')
-rw-r--r--apps/hosted/android/keyboard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/hosted/android/keyboard.c b/apps/hosted/android/keyboard.c
index eda951a7c9..b74f67e782 100644
--- a/apps/hosted/android/keyboard.c
+++ b/apps/hosted/android/keyboard.c
@@ -100,7 +100,7 @@ int kbd_input(char* text, int buflen, unsigned short *kbd)
100 if (accepted) 100 if (accepted)
101 { 101 {
102 utf8_string = e->GetStringUTFChars(env_ptr, new_string, 0); 102 utf8_string = e->GetStringUTFChars(env_ptr, new_string, 0);
103 strlcpy(text, utf8_string, buflen); 103 strmemccpy(text, utf8_string, buflen);
104 e->ReleaseStringUTFChars(env_ptr, new_string, utf8_string); 104 e->ReleaseStringUTFChars(env_ptr, new_string, utf8_string);
105 e->DeleteGlobalRef(env_ptr, new_string); 105 e->DeleteGlobalRef(env_ptr, new_string);
106 } 106 }