We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9aa3c9d commit 349c3b2Copy full SHA for 349c3b2
Modules/_localemodule.c
@@ -501,7 +501,7 @@ _locale_strxfrm_impl(PyObject *module, PyObject *str)
501
*/
502
size_t n3 = 0;
503
for (size_t i = 0; i < n2; i++) {
504
- if (buf[i] > 0x10000) {
+ if ((Py_UCS4)buf[i] > 0x10000u) {
505
n3++;
506
}
507
@@ -514,10 +514,10 @@ _locale_strxfrm_impl(PyObject *module, PyObject *str)
514
515
size_t j = 0;
516
517
- wchar_t c = buf[i];
518
- if (c > 0x10000) {
519
- buf2[j++] = (((Py_UCS4)c) >> 16) | 0x10000u;
520
- buf2[j++] = ((Py_UCS4)c) & 0xffffu;
+ Py_UCS4 c = (Py_UCS4)buf[i];
+ if (c > 0x10000u) {
+ buf2[j++] = (c >> 16) | 0x10000u;
+ buf2[j++] = c & 0xFFFFu;
521
522
else {
523
buf2[j++] = c;
0 commit comments