fmt_utf8 failed on ARM where char == unsigned char (Friedrich Beckmann)
This commit is contained in:
@@ -16,7 +16,7 @@ size_t fmt_utf8(char *dest,uint32_t n) {
|
||||
// width is undefined. That can't happen because both n>0x7f and
|
||||
// i>=n would have to be true and we initialize i as 0x3f and
|
||||
// with each iteration j is incremented. It's a false positive.
|
||||
*dest++=(char)(((char)0xc0 >> (j-1)) | (char)(n >> k));
|
||||
*dest++=(char)(((signed char)0xc0 >> (j-1)) | (char)(n >> k));
|
||||
while (k) {
|
||||
*dest++=(char)(0x80 | ((n >> (k-6)) & 0x3f));
|
||||
k-=6;
|
||||
|
||||
Reference in New Issue
Block a user