(iconv): Allow omitting output buffer if no input buffer is given to

place conversion descriptor in initial state.
This commit is contained in:
Ulrich Drepper 1999-12-21 07:17:16 +00:00
parent f6f6f71eca
commit 65a27c9b97

View File

@ -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
{