fix crash on input not matching dictionary

This commit is contained in:
penguin2233 2026-06-25 21:30:34 +10:00
commit 4f5103f778
2 changed files with 4 additions and 2 deletions

View file

@ -49,7 +49,9 @@ static void getcost_hira(SJ4_CONTEXT u_char* p, int* len) {
int getcost(SJ4_CONTEXT u_char* p) { int getcost(SJ4_CONTEXT u_char* p) {
char flg = TRUE; char flg = TRUE;
int i; int i;
int result; int result = 0;
if (!p) return result;
do { do {
if(p[codesize(*p)] == KANJISTREND) flg = FALSE; if(p[codesize(*p)] == KANJISTREND) flg = FALSE;

View file

@ -86,7 +86,7 @@ void mkjiritu(SJ4_CONTEXT int mode) {
static void static void
dic_mu(SJ4_CONTEXT int mode) { dic_mu(SJ4_CONTEXT int mode) {
u_char* tagp; u_char* tagp = NULL;
DICTL* dp; DICTL* dp;
for(dp = dictlist; dp; dp = dp->next) { for(dp = dictlist; dp; dp = dp->next) {