From: Ulrich Drepper Date: Tue, 21 Dec 1999 07:17:16 +0000 (+0000) Subject: (iconv): Allow omitting output buffer if no input buffer is given to X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65a27c9b97beba9819f649ff419611b14081f27c;p=thirdparty%2Fglibc.git (iconv): Allow omitting output buffer if no input buffer is given to place conversion descriptor in initial state. --- 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 {