diff options
author | gabor <gabor@FreeBSD.org> | 2011-09-19 22:49:36 +0000 |
---|---|---|
committer | gabor <gabor@FreeBSD.org> | 2011-09-19 22:49:36 +0000 |
commit | b58f76ef372ff96464c9636f74384df68dae97cc (patch) | |
tree | 7c3d99052551804a8bfe610b9a88debf9a699c72 /lib | |
parent | 1efb55f53105b1df36d713739fff5188859a9540 (diff) | |
download | FreeBSD-src-b58f76ef372ff96464c9636f74384df68dae97cc.zip FreeBSD-src-b58f76ef372ff96464c9636f74384df68dae97cc.tar.gz |
- Fix a trivial bug in iconv. When there is no space to perform the
conversion, conversion must fail and errno must be set to E2BIG.
PR: standards/160673
Submitted by: Henning Petersen <henning.petersen@t-online.de>
Reviewed by: pluknet
Approved by: re (kib), delphij (mentor)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/iconv/citrus_none.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/iconv/citrus_none.c b/lib/libc/iconv/citrus_none.c index 1f77ad0..9ec4bd3 100644 --- a/lib/libc/iconv/citrus_none.c +++ b/lib/libc/iconv/citrus_none.c @@ -190,7 +190,6 @@ _citrus_NONE_stdenc_wctomb(struct _citrus_stdenc * __restrict ce __unused, void * __restrict pspriv __unused, size_t * __restrict nresult, struct iconv_hooks *hooks __unused) { - int ret; if ((wc & ~0xFFU) != 0) { *nresult = (size_t)-1; @@ -198,7 +197,7 @@ _citrus_NONE_stdenc_wctomb(struct _citrus_stdenc * __restrict ce __unused, } if (n == 0) { *nresult = (size_t)-1; - ret = E2BIG; + return (E2BIG); } *nresult = 1; |