summaryrefslogtreecommitdiffstats
path: root/src/PYPPhoneticEditor.cc
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-03 11:31:05 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-22 12:23:14 +0800
commitff59fc1cc01c973d43cef4365293b906690c6481 (patch)
tree80d0fd4c116d96841f5928bac739019c8080b7ec /src/PYPPhoneticEditor.cc
parentad473e4b6d938b5e4cba72ecb49a4e5cc756cb4a (diff)
downloadibus-libpinyin-ff59fc1cc01c973d43cef4365293b906690c6481.tar.gz
ibus-libpinyin-ff59fc1cc01c973d43cef4365293b906690c6481.tar.xz
ibus-libpinyin-ff59fc1cc01c973d43cef4365293b906690c6481.zip
fixes select candidate
Diffstat (limited to 'src/PYPPhoneticEditor.cc')
-rw-r--r--src/PYPPhoneticEditor.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc
index 6be7079..dc66689 100644
--- a/src/PYPPhoneticEditor.cc
+++ b/src/PYPPhoneticEditor.cc
@@ -314,6 +314,10 @@ LibPinyinPhoneticEditor::getPinyinCursor ()
gboolean
LibPinyinPhoneticEditor::selectCandidate (guint i)
{
+
+ if (G_UNLIKELY (i >= m_candidates->len))
+ return FALSE;
+
guint pinyin_cursor = getPinyinCursor ();
/* NOTE: deal with normal candidates selection here by libpinyin. */