summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-05-27 14:06:25 +0800
committerPeng Wu <alexepico@gmail.com>2017-05-27 14:06:25 +0800
commit960e30985b27f955ce3ce41ed7540b9e237a8cba (patch)
tree64b20aa3379a529dac7a22106f7a5cad14555132
parent8da576800e82b922a3cb191a299cbacc1a0f7ef9 (diff)
downloadibus-libzhuyin-960e30985b27f955ce3ce41ed7540b9e237a8cba.tar.gz
ibus-libzhuyin-960e30985b27f955ce3ce41ed7540b9e237a8cba.tar.xz
ibus-libzhuyin-960e30985b27f955ce3ce41ed7540b9e237a8cba.zip
fixes a warning
-rw-r--r--src/ZYZPhoneticEditor.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc
index d7d570a..a3ce572 100644
--- a/src/ZYZPhoneticEditor.cc
+++ b/src/ZYZPhoneticEditor.cc
@@ -895,7 +895,8 @@ PhoneticEditor::getZhuyinCursor (void)
zhuyin_get_sentence (instance, &sentence);
if (cursor >= parsed_len) {
cursor -= parsed_len;
- zhuyin_cursor += g_utf8_strlen (sentence, -1);
+ if (sentence)
+ zhuyin_cursor += g_utf8_strlen (sentence, -1);
} else {
size_t length = 0;
zhuyin_get_character_offset