diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 21:16:55 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-06-17 21:16:55 -0400 |
commit | 4b337c5f245b6587ba844ac7bb13c313a2912f7b (patch) | |
tree | 999c6a6580b76a083c8efb9dabff709d1c49fcd0 /fs/ncpfs/ncplib_kernel.c | |
parent | 492b057c426e4aa747484958e18e9da29003985d (diff) | |
parent | 3fe0344faf7fdcb158bd5c1a9aec960a8d70c8e8 (diff) |
Merge commit 'origin/master' into next
Diffstat (limited to 'fs/ncpfs/ncplib_kernel.c')
-rw-r--r-- | fs/ncpfs/ncplib_kernel.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c index 97645f112114..0ec6237a5970 100644 --- a/fs/ncpfs/ncplib_kernel.c +++ b/fs/ncpfs/ncplib_kernel.c | |||
@@ -1113,11 +1113,13 @@ ncp__io2vol(struct ncp_server *server, unsigned char *vname, unsigned int *vlen, | |||
1113 | 1113 | ||
1114 | if (NCP_IS_FLAG(server, NCP_FLAG_UTF8)) { | 1114 | if (NCP_IS_FLAG(server, NCP_FLAG_UTF8)) { |
1115 | int k; | 1115 | int k; |
1116 | unicode_t u; | ||
1116 | 1117 | ||
1117 | k = utf8_mbtowc(&ec, iname, iname_end - iname); | 1118 | k = utf8_to_utf32(iname, iname_end - iname, &u); |
1118 | if (k < 0) | 1119 | if (k < 0 || u > MAX_WCHAR_T) |
1119 | return -EINVAL; | 1120 | return -EINVAL; |
1120 | iname += k; | 1121 | iname += k; |
1122 | ec = u; | ||
1121 | } else { | 1123 | } else { |
1122 | if (*iname == NCP_ESC) { | 1124 | if (*iname == NCP_ESC) { |
1123 | int k; | 1125 | int k; |
@@ -1214,7 +1216,7 @@ ncp__vol2io(struct ncp_server *server, unsigned char *iname, unsigned int *ilen, | |||
1214 | if (NCP_IS_FLAG(server, NCP_FLAG_UTF8)) { | 1216 | if (NCP_IS_FLAG(server, NCP_FLAG_UTF8)) { |
1215 | int k; | 1217 | int k; |
1216 | 1218 | ||
1217 | k = utf8_wctomb(iname, ec, iname_end - iname); | 1219 | k = utf32_to_utf8(ec, iname, iname_end - iname); |
1218 | if (k < 0) { | 1220 | if (k < 0) { |
1219 | err = -ENAMETOOLONG; | 1221 | err = -ENAMETOOLONG; |
1220 | goto quit; | 1222 | goto quit; |