@@ -1264,7 +1264,7 @@ DECLARE_ISO_FUNCS(16)
1264
1264
#endif /* LIBXML_ISO8859X_ENABLED */
1265
1265
1266
1266
#ifdef LIBXML_ICONV_ENABLED
1267
- #define EMPTY_ICONV , (iconv_t) 0 , (iconv_t) 0
1267
+ #define EMPTY_ICONV , (iconv_t) -1 , (iconv_t) -1
1268
1268
#else
1269
1269
#define EMPTY_ICONV
1270
1270
#endif
@@ -1389,8 +1389,8 @@ xmlNewCharEncodingHandler(const char *name,
1389
1389
handler -> name = up ;
1390
1390
1391
1391
#ifdef LIBXML_ICONV_ENABLED
1392
- handler -> iconv_in = NULL ;
1393
- handler -> iconv_out = NULL ;
1392
+ handler -> iconv_in = ( iconv_t ) - 1 ;
1393
+ handler -> iconv_out = ( iconv_t ) - 1 ;
1394
1394
#endif
1395
1395
#ifdef LIBXML_ICU_ENABLED
1396
1396
handler -> uconv_in = NULL ;
@@ -1641,6 +1641,10 @@ xmlCreateUconvHandler(const char *name, xmlCharEncodingHandler **out) {
1641
1641
}
1642
1642
enc -> input = NULL ;
1643
1643
enc -> output = NULL ;
1644
+ #ifdef LIBXML_ICONV_ENABLED
1645
+
F438
span> enc -> iconv_in = (iconv_t ) - 1 ;
1646
+ enc -> iconv_out = (iconv_t ) - 1 ;
1647
+ #endif
1644
1648
enc -> uconv_in = ucv_in ;
1645
1649
enc -> uconv_out = ucv_out ;
1646
1650
@@ -2200,7 +2204,7 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
2200
2204
}
2201
2205
}
2202
2206
#ifdef LIBXML_ICONV_ENABLED
2203
- else if (handler -> iconv_in != NULL ) {
2207
+ else if (handler -> iconv_in != ( iconv_t ) - 1 ) {
2204
2208
ret = xmlIconvWrapper (handler -> iconv_in , out , outlen , in , inlen );
2205
2209
}
2206
2210
#endif /* LIBXML_ICONV_ENABLED */
@@ -2260,7 +2264,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
2260
2264
}
2261
2265
}
2262
2266
#ifdef LIBXML_ICONV_ENABLED
2263
- else if (handler -> iconv_out != NULL ) {
2267
+ else if (handler -> iconv_out != ( iconv_t ) - 1 ) {
2264
2268
ret = xmlIconvWrapper (handler -> iconv_out , out , outlen , in , inlen );
2265
2269
}
2266
2270
#endif /* LIBXML_ICONV_ENABLED */
@@ -2672,17 +2676,17 @@ xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
2672
2676
* Iconv handlers can be used only once, free the whole block.
2673
2677
* and the associated icon resources.
2674
2678
*/
2675
- if ((handler -> iconv_out != NULL ) || (handler -> iconv_in != NULL )) {
2679
+ if ((handler -> iconv_out != ( iconv_t ) - 1 ) || (handler -> iconv_in != ( iconv_t ) - 1 )) {
2676
2680
tofree = 1 ;
2677
- if (handler -> iconv_out != NULL ) {
2681
+ if (handler -> iconv_out != ( iconv_t ) - 1 ) {
2678
2682
if (iconv_close (handler -> iconv_out ))
2679
2683
ret = -1 ;
2680
- handler -> iconv_out = NULL ;
2684
+ handler -> iconv_out = ( iconv_t ) - 1 ;
2681
2685
}
2682
- if (handler -> iconv_in != NULL ) {
2686
+ if (handler -> iconv_in != ( iconv_t ) - 1 ) {
2683
2687
if (iconv_close (handler -> iconv_in ))
2684
2688
ret = -1 ;
2685
- handler -> iconv_in = NULL ;
2689
+ handler -> iconv_in = ( iconv_t ) - 1 ;
2686
2690
}
2687
2691
}
2688
2692
#endif /* LIBXML_ICONV_ENABLED */
0 commit comments