Skip to content
Snippets Groups Projects
Commit 91b2dd4c authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Fix "Failed to initialize collation"

ucol_open() expects null-terminated string.
GCC doesn't initialize locale name buffer in RelWithDebInfo.

Fixes #2819
parent 2097908f
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,7 @@ coll_icu_init_cmp(struct coll *coll, const struct coll_def *def)
}
char locale[MAX_LOCALE];
memcpy(locale, def->locale, def->locale_len);
locale[def->locale_len] = '\0';
UErrorCode status = U_ZERO_ERROR;
struct UCollator *collator = ucol_open(locale, &status);
if (U_FAILURE(status)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment