1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-01 00:58:16 +03:00

fixed a regression in iconv support. Daniel

* encoding.c: fixed a regression in iconv support.
Daniel
This commit is contained in:
Daniel Veillard 2004-11-06 13:26:59 +00:00
parent ce682bc24b
commit 01ca83cd4c
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Sat Nov 6 14:27:18 CET 2004 Daniel Veillard <daniel@veillard.com>
* encoding.c: fixed a regression in iconv support.
Fri Nov 5 18:19:23 CET 2004 Daniel Veillard <daniel@veillard.com>
* gentest.py testapi.c: autogenerate a minimal NULL value sequence

View File

@ -1670,8 +1670,10 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
char *icv_out = (char *) out;
int ret;
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL))
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
if (outlen != NULL) *outlen = 0;
return(-1);
}
icv_inlen = *inlen;
icv_outlen = *outlen;
ret = iconv(cd, (char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
@ -2166,7 +2168,7 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) {
written = 32000;
ret = xmlIconvWrapper(handler->iconv_out, &convbuf[0],
&written, cur, &toconv);
if (ret == -1) {
if (ret < 0) {
if (written > 0)
ret = -2;
else