diff options
-rw-r--r-- | src/enchant.h | 4 | ||||
-rw-r--r-- | src/lib.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/enchant.h b/src/enchant.h index 20e2d24..2211fa4 100644 --- a/src/enchant.h +++ b/src/enchant.h @@ -170,8 +170,8 @@ int enchant_dict_check (EnchantDict * dict, const char *const word, ssize_t len) * @len: The byte length of @word, or -1 for strlen (@word) * @out_n_suggs: The location to store the # of suggestions returned, or %null * - * Will return an %null value if any of those pre-conditions - * are not met. + * Will return a %null value if any of those pre-conditions + * is not met. * * Returns: A %null terminated list of UTF-8 encoded suggestions, or %null */ @@ -548,8 +548,11 @@ enchant_dict_suggest (EnchantDict * dict, const char *const word, ssize_t len, s if (n_suggs > 0) { suggs = g_new0 (char *, n_suggs + 1); - n_suggs = enchant_dict_merge_suggestions(suggs, 0, dict_suggs, n_dict_suggs); - n_suggs = enchant_dict_merge_suggestions(suggs, n_suggs, pwl_suggs, n_pwl_suggs); + n_suggs = 0; + if (dict_suggs != NULL) + n_suggs = enchant_dict_merge_suggestions(suggs, n_suggs, dict_suggs, n_dict_suggs); + if (pwl_suggs != NULL) + n_suggs = enchant_dict_merge_suggestions(suggs, n_suggs, pwl_suggs, n_pwl_suggs); } g_strfreev(dict_suggs); |