diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-04-24 08:11:40 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 04:44:43 (GMT) |
commit | e27ecdd94d81e5bc3d1f68591701db5adb342f0d (patch) | |
tree | f053d06177c18796c6d09fd42765d262f9462c92 /fs/nls/nls_base.c | |
parent | 97d7b7a41bd462abceee7dbb2b3afacfd52438ed (diff) | |
download | linux-fsl-qoriq-e27ecdd94d81e5bc3d1f68591701db5adb342f0d.tar.xz |
nls: utf8_wcstombs: use correct buffer size in error case
When utf8_wcstombs encounters a character that cannot be encoded, we
must not decrease the remaining output buffer size because nothing has
been written to the output buffer.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/nls/nls_base.c')
-rw-r--r-- | fs/nls/nls_base.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c index 9b0efda..000736d 100644 --- a/fs/nls/nls_base.c +++ b/fs/nls/nls_base.c @@ -144,7 +144,6 @@ utf8_wcstombs(__u8 *s, const wchar_t *pwcs, int maxlen) size = utf8_wctomb(op, *ip, maxlen); if (size == -1) { /* Ignore character and move on */ - maxlen--; } else { op += size; maxlen -= size; |