libcpp/charset: close out shift states

Tom Tromey tromey@redhat.com
Mon Dec 10 18:53:00 GMT 2007


>>>>> "DJ" == DJ Delorie <dj@redhat.com> writes:

DJ> +	  /* Close out any shift states, returning to the initial state.  */
DJ> +	  if (iconv (cd, 0, 0, &outbuf, &outbytesleft) == (size_t)-1)
DJ> +	    return false;

What if this new iconv call returns -1 with errno==E2BIG?  In this
case, we will return false -- but I think what we really want to do is
resize the output buffer and try again.

I think with a change to fix this problem, this is ok.

Tom



More information about the Gcc-patches mailing list