mirror of
https://github.com/samba-team/samba.git
synced 2025-01-13 13:18:06 +03:00
r938: on an error save the original errno before calling iconv to reset
the conversion state
(This used to be commit 4a5a122b3a
)
This commit is contained in:
parent
fe8977e12c
commit
81c497b38b
@ -129,7 +129,11 @@ static size_t sys_iconv(void *cd,
|
||||
size_t ret = iconv((iconv_t)cd,
|
||||
inbuf, inbytesleft,
|
||||
outbuf, outbytesleft);
|
||||
if (ret == (size_t)-1) iconv(cd, NULL, NULL, NULL, NULL);
|
||||
if (ret == (size_t)-1) {
|
||||
int saved_errno = errno;
|
||||
iconv(cd, NULL, NULL, NULL, NULL);
|
||||
errno = saved_errno;
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
errno = EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user