diff options
Diffstat (limited to 'iconv/iconv.c')
-rw-r--r-- | iconv/iconv.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/iconv/iconv.c b/iconv/iconv.c index ee16d3b..c1b9616 100644 --- a/iconv/iconv.c +++ b/iconv/iconv.c @@ -39,9 +39,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 { |