diff options
-rw-r--r-- | mbbsd/read.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c index fd28bcea..254678a8 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -783,8 +783,10 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int ch, int bid) default: if( ch == 'h' && currmode & (MODE_ETC | MODE_DIGEST) ) return DONOTHING; - if (ch > 0 && ch < onekey_size) { - mode = (*(rcmdlist[ch - 1]))(locmem->crs_ln, &headers[locmem->crs_ln - locmem->top_ln], currdirect); + if (ch > 0 && ch <= onekey_size) { + int (*func)() = rcmdlist[ch - 1]; + if (func != NULL) + mode = (*func)(locmem->crs_ln, &headers[locmem->crs_ln - locmem->top_ln], currdirect); break; } } |