summaryrefslogtreecommitdiffstats
path: root/src/PYPPhoneticEditor.cc
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-11-14 14:23:10 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-22 12:23:15 +0800
commit0fb453ad10c68a4a4462c1e163afd5825696d9d3 (patch)
treea4a08f235ed4c00e8dae229053ba642257e302cb /src/PYPPhoneticEditor.cc
parent3fbb80c187f3dc4b7296d838a78a054fe82d3266 (diff)
downloadibus-libpinyin-0fb453ad10c68a4a4462c1e163afd5825696d9d3.tar.gz
ibus-libpinyin-0fb453ad10c68a4a4462c1e163afd5825696d9d3.tar.xz
ibus-libpinyin-0fb453ad10c68a4a4462c1e163afd5825696d9d3.zip
fixes fill candidates
Diffstat (limited to 'src/PYPPhoneticEditor.cc')
-rw-r--r--src/PYPPhoneticEditor.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc
index b691e88..a713a71 100644
--- a/src/PYPPhoneticEditor.cc
+++ b/src/PYPPhoneticEditor.cc
@@ -192,6 +192,9 @@ LibPinyinPhoneticEditor::fillLookupTableByPage (void)
String first_candidate, candidate;
for (guint i = filled_nr; i < filled_nr + need_nr; i++) {
+ if (i >= m_candidates->len) /* no more candidates */
+ break;
+
phrase_token_t *token = &g_array_index
(m_candidates, phrase_token_t, i);