fix(charset): fix wrong display of 0xffff (#24158)

This commit is contained in:
zeertzjq
2023-06-26 11:52:52 +08:00
committed by GitHub
parent 91aeaeef64
commit cd6458123f
2 changed files with 17 additions and 3 deletions

View File

@@ -645,8 +645,8 @@ size_t transchar_hex(char *const buf, const int c)
size_t i = 0;
buf[i++] = '<';
if (c > 255) {
if (c > 255 * 256) {
if (c > 0xFF) {
if (c > 0xFFFF) {
buf[i++] = (char)nr2hex((unsigned)c >> 20);
buf[i++] = (char)nr2hex((unsigned)c >> 16);
}