mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 15:51:49 +00:00
[LIBXML2] Update to version 2.9.13. CORE-17766
This commit is contained in:
parent
df1adce32c
commit
7244e0c5c6
35 changed files with 1127 additions and 20110 deletions
32
sdk/lib/3rdparty/libxml2/encoding.c
vendored
32
sdk/lib/3rdparty/libxml2/encoding.c
vendored
|
@ -527,7 +527,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
|
|||
in++;
|
||||
}
|
||||
if ((c & 0xFC00) == 0xD800) { /* surrogates */
|
||||
if (in >= inend) { /* (in > inend) shouldn't happens */
|
||||
if (in >= inend) { /* handle split mutli-byte characters */
|
||||
break;
|
||||
}
|
||||
if (xmlLittleEndian) {
|
||||
|
@ -744,38 +744,39 @@ UTF16BEToUTF8(unsigned char* out, int *outlen,
|
|||
{
|
||||
unsigned char* outstart = out;
|
||||
const unsigned char* processed = inb;
|
||||
unsigned char* outend = out + *outlen;
|
||||
unsigned char* outend;
|
||||
unsigned short* in = (unsigned short*) inb;
|
||||
unsigned short* inend;
|
||||
unsigned int c, d, inlen;
|
||||
unsigned char *tmp;
|
||||
int bits;
|
||||
|
||||
if (*outlen == 0) {
|
||||
*inlenb = 0;
|
||||
return(0);
|
||||
}
|
||||
outend = out + *outlen;
|
||||
if ((*inlenb % 2) == 1)
|
||||
(*inlenb)--;
|
||||
inlen = *inlenb / 2;
|
||||
inend= in + inlen;
|
||||
while (in < inend) {
|
||||
while ((in < inend) && (out - outstart + 5 < *outlen)) {
|
||||
if (xmlLittleEndian) {
|
||||
tmp = (unsigned char *) in;
|
||||
c = *tmp++;
|
||||
c = c << 8;
|
||||
c = c | (unsigned int) *tmp;
|
||||
c = (c << 8) | (unsigned int) *tmp;
|
||||
in++;
|
||||
} else {
|
||||
c= *in++;
|
||||
}
|
||||
if ((c & 0xFC00) == 0xD800) { /* surrogates */
|
||||
if (in >= inend) { /* (in > inend) shouldn't happens */
|
||||
*outlen = out - outstart;
|
||||
*inlenb = processed - inb;
|
||||
return(-2);
|
||||
if (in >= inend) { /* handle split mutli-byte characters */
|
||||
break;
|
||||
}
|
||||
if (xmlLittleEndian) {
|
||||
tmp = (unsigned char *) in;
|
||||
d = *tmp++;
|
||||
d = d << 8;
|
||||
d = d | (unsigned int) *tmp;
|
||||
d = (d << 8) | (unsigned int) *tmp;
|
||||
in++;
|
||||
} else {
|
||||
d= *in++;
|
||||
|
@ -1822,7 +1823,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
|
|||
size_t icv_inlen, icv_outlen;
|
||||
const char *icv_in = (const char *) in;
|
||||
char *icv_out = (char *) out;
|
||||
int ret;
|
||||
size_t ret;
|
||||
|
||||
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
|
||||
if (outlen != NULL) *outlen = 0;
|
||||
|
@ -1833,7 +1834,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
|
|||
ret = iconv(cd, (ICONV_CONST char **) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
|
||||
*inlen -= icv_inlen;
|
||||
*outlen -= icv_outlen;
|
||||
if ((icv_inlen != 0) || (ret == -1)) {
|
||||
if ((icv_inlen != 0) || (ret == (size_t) -1)) {
|
||||
#ifdef EILSEQ
|
||||
if (errno == EILSEQ) {
|
||||
return -2;
|
||||
|
@ -2495,7 +2496,7 @@ retry:
|
|||
*/
|
||||
toconv = xmlBufUse(in);
|
||||
if (toconv == 0)
|
||||
return (0);
|
||||
return (writtentot);
|
||||
if (toconv > 64 * 1024)
|
||||
toconv = 64 * 1024;
|
||||
if (toconv * 4 >= written) {
|
||||
|
@ -2629,7 +2630,6 @@ xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
|
|||
int written;
|
||||
int writtentot = 0;
|
||||
int toconv;
|
||||
int output = 0;
|
||||
|
||||
if (handler == NULL) return(-1);
|
||||
if (out == NULL) return(-1);
|
||||
|
@ -2682,8 +2682,6 @@ retry:
|
|||
ret = -3;
|
||||
}
|
||||
|
||||
if (ret >= 0) output += ret;
|
||||
|
||||
/*
|
||||
* Attempt to handle error cases
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue