mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-03 04:01:43 +08:00
(iconv): Allow omitting output buffer if no input buffer is given to
place conversion descriptor in initial state.
This commit is contained in:
parent
f6f6f71eca
commit
65a27c9b97
@ -38,9 +38,12 @@ iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf,
|
||||
|
||||
if (inbuf == NULL || *inbuf == NULL)
|
||||
{
|
||||
result = __gconv (gcd, NULL, NULL, (unsigned char **) outbuf,
|
||||
(unsigned char *) (outstart + *outbytesleft),
|
||||
&converted);
|
||||
if (outbuf == NULL || *outbuf == NULL)
|
||||
result = __gconv (gcd, NULL, NULL, NULL, NULL, &converted);
|
||||
else
|
||||
result = __gconv (gcd, NULL, NULL, (unsigned char **) outbuf,
|
||||
(unsigned char *) (outstart + *outbytesleft),
|
||||
&converted);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user