[uim-commit] r965 - trunk/uim
ekato at freedesktop.org
ekato at freedesktop.org
Mon Jul 11 15:45:08 EST 2005
Author: ekato
Date: 2005-07-10 22:45:04 -0700 (Sun, 10 Jul 2005)
New Revision: 965
Modified:
trunk/uim/skk.c
Log:
* skk.c (get_ignoring_indices) : Check array size.
Modified: trunk/uim/skk.c
===================================================================
--- trunk/uim/skk.c 2005-07-10 17:05:41 UTC (rev 964)
+++ trunk/uim/skk.c 2005-07-11 05:45:04 UTC (rev 965)
@@ -60,6 +60,8 @@
#define skk_isupper(ch) ((((unsigned char)ch) >= 'A') && (((unsigned char)ch) <= 'Z'))
#define skk_isascii(ch) ((((unsigned char)ch) & ~0x7f) == 0)
+#define IGNORING_WORD_MAX 63
+
/*
* cand : candidate
*/
@@ -1465,6 +1467,8 @@
k++;
for (i = ca->nr_real_cands; i < ca->nr_cands; i++) {
+ if (k >= IGNORING_WORD_MAX)
+ break;
for (j = 0; j < nr_purged; j++) {
if (!strcmp(ca->cands[i], purged_words[j])) {
indices[k] = i;
@@ -1494,7 +1498,7 @@
int mark;
uim_lisp str_ = uim_scm_null_list();
- int ignoring_indices[64]; /* XXX is it enough? */
+ int ignoring_indices[IGNORING_WORD_MAX + 1];
n = uim_scm_c_int(nth_);
ca = find_cand_array_lisp(head_, okuri_head_, okuri_, 0);
@@ -1566,7 +1570,7 @@
const char *numstr;
int method_place = 0;
- int ignoring_indices[64]; /* XXX is it enough? */
+ int ignoring_indices[IGNORING_WORD_MAX + 1];
ca = find_cand_array_lisp(head_, okuri_head_, okuri_, 0);
if (ca)
@@ -2022,7 +2026,7 @@
const char *numstr;
int method_place = 0;
- int ignoring_indices[64]; /* XXX is it enough? */
+ int ignoring_indices[IGNORING_WORD_MAX + 1];
nth = uim_scm_c_int(nth_);
ca = find_cand_array_lisp(head_, okuri_head_, okuri_, 0);
@@ -2149,7 +2153,7 @@
const char *numstr;
int method_place = 0;
- int ignoring_indices[64]; /* XXX is it enough? */
+ int ignoring_indices[IGNORING_WORD_MAX + 1];
ca = find_cand_array_lisp(head_, okuri_head_, okuri_, 0);
if (!ca)
More information about the uim-commit
mailing list