Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33247
b: refs/heads/master
c: 94f563c
h: refs/heads/master
i:
  33245: c95c2cd
  33243: 4e05770
  33239: fda0c69
  33231: 697604d
  33215: d8ddba9
v: v3
  • Loading branch information
Diego Calleja authored and Linus Torvalds committed Aug 6, 2006
1 parent fe79888 commit ab5ba3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e31f59ce593b073ee14241781edfb0637697eeb6
refs/heads/master: 94f563c426a78c97fc2a377315995e6ec8343872
11 changes: 9 additions & 2 deletions trunk/fs/befs/linuxvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,11 @@ befs_utf2nls(struct super_block *sb, const char *in,
wchar_t uni;
int unilen, utflen;
char *result;
int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
/* The utf8->nls conversion won't make the final nls string bigger
* than the utf one, but if the string is pure ascii they'll have the
* same width and an extra char is needed to save the additional \0
*/
int maxlen = in_len + 1;

befs_debug(sb, "---> utf2nls()");

Expand Down Expand Up @@ -588,7 +592,10 @@ befs_nls2utf(struct super_block *sb, const char *in,
wchar_t uni;
int unilen, utflen;
char *result;
int maxlen = 3 * in_len;
/* There're nls characters that will translate to 3-chars-wide UTF-8
* characters, a additional byte is needed to save the final \0
* in special cases */
int maxlen = (3 * in_len) + 1;

befs_debug(sb, "---> nls2utf()\n");

Expand Down

0 comments on commit ab5ba3c

Please sign in to comment.