diff options
Diffstat (limited to 'hangul')
-rw-r--r-- | hangul/hanja.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/hangul/hanja.c b/hangul/hanja.c index 0cc7349..0cbe347 100644 --- a/hangul/hanja.c +++ b/hangul/hanja.c @@ -436,15 +436,19 @@ hanja_table_match(const HanjaTable* table, char* p = strtok_r(buf, ":", &save); res = strcmp(p, key); if (res == 0) { + if (*list == NULL) { + *list = hanja_list_new(key); + } + + if (*list == NULL) { + break; + } + char* value = strtok_r(NULL, ":", &save); char* comment = strtok_r(NULL, "\r\n", &save); Hanja* hanja = hanja_new(p, value, comment); - if (*list == NULL) { - *list = hanja_list_new(key); - } - hanja_list_append_n(*list, hanja, 1); } else if (res > 0) { break; |