From c2bb4e3fe51f9b9940440ea81d5d97b56d5582e7 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sun, 15 Sep 2024 12:02:22 -0400 Subject: [PATCH] fix type mismatch and memory deallocation build errors Signed-off-by: Rui Chen --- src/stardict_lib.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stardict_lib.cpp b/src/stardict_lib.cpp index 83fbc59..8d9929f 100644 --- a/src/stardict_lib.cpp +++ b/src/stardict_lib.cpp @@ -1047,12 +1047,11 @@ bool Libs::LookupSimilarWord(const gchar *sWord, std::set &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;