From 65a27c9b97beba9819f649ff419611b14081f27c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 21 Dec 1999 07:17:16 +0000 Subject: [PATCH] (iconv): Allow omitting output buffer if no input buffer is given to place conversion descriptor in initial state. --- iconv/iconv.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iconv/iconv.c b/iconv/iconv.c index a6c84367a74..a4452532499 100644 --- a/iconv/iconv.c +++ b/iconv/iconv.c @@ -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 { -- 2.47.2