diff --git a/ChangeLog b/ChangeLog index ddcf7e3f..3dca6936 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 31 16:33:54 CET 2004 Daniel Veillard + + * encoding.c doc/examples/testWriter.c: Fixed bug #153937, making + sure the conversion functions return the number of byte written. + Had to fix one of the examples. + Fri Oct 29 14:16:56 CEST 2004 Daniel Veillard * doc/xmllint.1 doc/xmllint.xml: indicate - means stdin closing #156626 diff --git a/configure.in b/configure.in index ed6b94c4..53b8a24f 100644 --- a/configure.in +++ b/configure.in @@ -309,7 +309,7 @@ else CFLAGS="${CFLAGS} -fexceptions" fi - CFLAGS="${CFLAGS} -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" + CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" case "${host}" in alpha*-*-linux* ) CFLAGS="${CFLAGS} -mieee" @@ -447,7 +447,7 @@ if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ fi fi if test "${CC}" = "gcc" ; then - CFLAGS="-g -O -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall" + CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall" fi STATIC_BINARIES="-static" dnl -Wcast-qual -ansi diff --git a/doc/examples/testWriter.c b/doc/examples/testWriter.c index c5e9c39c..e158f974 100644 --- a/doc/examples/testWriter.c +++ b/doc/examples/testWriter.c @@ -1168,8 +1168,8 @@ ConvertInput(const char *in, const char *encoding) if (out != 0) { temp = size - 1; ret = handler->input(out, &out_size, (const xmlChar *) in, &temp); - if (ret || temp - size + 1) { - if (ret) { + if ((ret < 0) || (temp - size + 1)) { + if (ret < 0) { printf("ConvertInput: conversion wasn't successful.\n"); } else { printf diff --git a/encoding.c b/encoding.c index e05c3750..cf45cba2 100644 --- a/encoding.c +++ b/encoding.c @@ -125,7 +125,7 @@ asciiToUTF8(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlen = processed - base; - return(0); + return(*outlen); } #ifdef LIBXML_OUTPUT_ENABLED @@ -209,7 +209,7 @@ UTF8Toascii(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlen = processed - instart; - return(0); + return(*outlen); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -255,7 +255,7 @@ isolat1ToUTF8(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlen = in - base; - return(0); + return(*outlen); } /** @@ -291,7 +291,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen, *outlen = len; *inlenb = len; - return(0); + return(*outlen); } @@ -381,7 +381,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlen = processed - instart; - return(0); + return(*outlen); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -470,7 +470,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlenb = processed - inb; - return(0); + return(*outlen); } #ifdef LIBXML_OUTPUT_ENABLED @@ -578,7 +578,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen, } *outlen = (out - outstart) * 2; *inlen = processed - instart; - return(0); + return(*outlen); } /** @@ -710,7 +710,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlenb = processed - inb; - return(0); + return(*outlen); } #ifdef LIBXML_OUTPUT_ENABLED @@ -815,7 +815,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen, } *outlen = (out - outstart) * 2; *inlen = processed - instart; - return(0); + return(*outlen); } #endif /* LIBXML_OUTPUT_ENABLED */ @@ -2290,7 +2290,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlen = in - instart; - return(0); + return(*outlen); } /** @@ -2350,7 +2350,7 @@ ISO8859xToUTF8(unsigned char* out, int *outlen, } *outlen = out - outstart; *inlen = in - instart; - return (0); + return (*outlen); }