Skip to content

Commit c451785

Browse files
committed
Fix review
1 parent 73bf94a commit c451785

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

goinkview.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ int main_handler(int t, int p1, int p2) {
55
}
66

77
void c_keyboard_handler(char* text) {
8-
keyboardHandler(text);
8+
goKeyboardHandler(text);
99
}

keyboard.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"unsafe"
1414
)
1515

16-
//export keyboardHandler
17-
func keyboardHandler(text *C.char) {
16+
//export goKeyboardHandler
17+
func goKeyboardHandler(text *C.char) {
1818
userKeyboardHandler(C.GoString(text))
1919
}
2020

@@ -28,6 +28,10 @@ func SetKeyboardHandler(kh KeyboardHandler) {
2828

2929
func OpenKeyboard(placeholder string, buflen int) {
3030

31+
if buflen <= 0 {
32+
buflen = 1024
33+
}
34+
3135
buffer := make([]byte, buflen)
3236

3337
ctitle := C.CString(placeholder)

0 commit comments

Comments
 (0)