diff options
| -rw-r--r-- | fs/cifs/cifs_unicode.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c index 23d43cde4306..1b2e180b018d 100644 --- a/fs/cifs/cifs_unicode.c +++ b/fs/cifs/cifs_unicode.c | |||
| @@ -277,6 +277,7 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen, | |||
| 277 | 277 | ||
| 278 | for (i = 0, j = 0; i < srclen; j++) { | 278 | for (i = 0, j = 0; i < srclen; j++) { |
| 279 | src_char = source[i]; | 279 | src_char = source[i]; |
| 280 | charlen = 1; | ||
| 280 | switch (src_char) { | 281 | switch (src_char) { |
| 281 | case 0: | 282 | case 0: |
| 282 | put_unaligned(0, &target[j]); | 283 | put_unaligned(0, &target[j]); |
| @@ -316,16 +317,13 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen, | |||
| 316 | dst_char = cpu_to_le16(0x003f); | 317 | dst_char = cpu_to_le16(0x003f); |
| 317 | charlen = 1; | 318 | charlen = 1; |
| 318 | } | 319 | } |
| 319 | /* | ||
| 320 | * character may take more than one byte in the source | ||
| 321 | * string, but will take exactly two bytes in the | ||
| 322 | * target string | ||
| 323 | */ | ||
| 324 | i += charlen; | ||
| 325 | continue; | ||
| 326 | } | 320 | } |
| 321 | /* | ||
| 322 | * character may take more than one byte in the source string, | ||
| 323 | * but will take exactly two bytes in the target string | ||
| 324 | */ | ||
| 325 | i += charlen; | ||
| 327 | put_unaligned(dst_char, &target[j]); | 326 | put_unaligned(dst_char, &target[j]); |
| 328 | i++; /* move to next char in source string */ | ||
| 329 | } | 327 | } |
| 330 | 328 | ||
| 331 | ctoUCS_out: | 329 | ctoUCS_out: |
