Skip to content

Commit

Permalink
fix type mismatch and memory deallocation build errors
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Sep 15, 2024
1 parent beebb0f commit c2bb4e3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/stardict_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,12 +1047,11 @@ bool Libs::LookupSimilarWord(const gchar *sWord, std::set<glong> &iWordIndices,
}
// Upper the first character and lower others.
if (!bFound) {
gchar *nextchar = g_utf8_next_char(sWord);
const gchar *nextchar = g_utf8_next_char(sWord);
gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
nextchar = g_utf8_strdown(nextchar, -1);
casestr = g_strdup_printf("%s%s", firstchar, nextchar);
g_free(firstchar);
g_free(nextchar);
if (strcmp(casestr, sWord)) {
if (oLib[iLib]->Lookup(casestr, iWordIndices))
bFound = true;
Expand Down

0 comments on commit c2bb4e3

Please sign in to comment.