summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2003-12-16 01:52:54 +0000
committertjr <tjr@FreeBSD.org>2003-12-16 01:52:54 +0000
commit7750c90c2f3c55b175923f25e571e9b435a00591 (patch)
treedb0c08cec9d0a0848fd69f89b35ba8cdc5fe40ec /sys/fs
parentc1cde66b1497ed1bd7f60b3c2e16851dba1cafe3 (diff)
downloadFreeBSD-src-7750c90c2f3c55b175923f25e571e9b435a00591.zip
FreeBSD-src-7750c90c2f3c55b175923f25e571e9b435a00591.tar.gz
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.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ntfs/ntfs_subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c
index aff97a3..ee1c71b 100644
--- a/sys/fs/ntfs/ntfs_subr.c
+++ b/sys/fs/ntfs/ntfs_subr.c
@@ -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
OpenPOWER on IntegriCloud