Commit 5d577ae9 authored by Brendan McGrath's avatar Brendan McGrath Committed by Alexandre Julliard

libwine: get_sortkey to return consistent length with and without dstlen.

parent 7c1e0ef7
......@@ -2366,7 +2366,6 @@ static void test_LCMapStringA(void)
ret2 = LCMapStringA(LOCALE_USER_DEFAULT, LCMAP_SORTKEY,
upper_case, lstrlenA(upper_case), NULL, 0);
ok(ret2, "LCMapStringA must succeed\n");
todo_wine
ok(ret == ret2, "lengths of sort keys must be equal (%d vs %d)\n", ret, ret2);
/* test LCMAP_SORTKEY | NORM_IGNORECASE */
......
......@@ -79,8 +79,8 @@ int wine_get_sortkey(int flags, const WCHAR *src, int srclen, char *dst, int dst
}
if (!dstlen) /* compute length */
/* 4 * '\1' + 1 * '\0' + key length */
return key_len[0] + key_len[1] + key_len[2] + key_len[3] + 4 + 1;
/* 4 * '\1' + key length */
return key_len[0] + key_len[1] + key_len[2] + key_len[3] + 4;
if (dstlen < key_len[0] + key_len[1] + key_len[2] + key_len[3] + 4 + 1)
return 0; /* overflow */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment