Avoid sign extension when casting signed characters to unsigned wide
characters in ntfs_u28(). This fixes the conversion of filenames containing single-byte characters with the high bit set.
This commit is contained in:
parent
c1cde66b14
commit
7750c90c2f
@ -2157,7 +2157,7 @@ ntfs_u28(
|
||||
ntfs_iconv->convchr(ntmp->ntm_ic_u2l, (const char **)&p, &ilen,
|
||||
&outp, &olen);
|
||||
if (olen == 1) {
|
||||
return ((wchar)(outbuf[0]));
|
||||
return ((wchar)(outbuf[0]&0xFF));
|
||||
} else if (olen == 0) {
|
||||
return ((wchar)((outbuf[0]<<8) | (outbuf[1]&0xFF)));
|
||||
}
|
||||
@ -2167,7 +2167,7 @@ ntfs_u28(
|
||||
p = ntmp->ntm_u28[(wc>>8)&0xFF];
|
||||
if (p == NULL)
|
||||
return ('_');
|
||||
return (p[wc&0xFF]);
|
||||
return (p[wc&0xFF]&0xFF);
|
||||
}
|
||||
|
||||
wchar
|
||||
|
Loading…
Reference in New Issue
Block a user