Ticket #43895: patch-src-xercesc-util-XMLUTF8Transcoder.cpp.diff
File patch-src-xercesc-util-XMLUTF8Transcoder.cpp.diff, 2.6 KB (added by gallafent, 10 years ago) |
---|
-
src/xercesc/util/XMLUTF8Transcoder.cpp
old new 178 178 if((gUTFByteIndicatorTest[trailingBytes] & *srcPtr) != gUTFByteIndicator[trailingBytes]) { 179 179 char pos[2] = {(char)0x31, 0}; 180 180 char len[2] = {(char)(trailingBytes+0x31), 0}; 181 char byte[2] = { *srcPtr,0};181 char byte[2] = {static_cast<char>(*srcPtr),0}; 182 182 ThrowXMLwithMemMgr3(UTFDataFormatException, XMLExcepts::UTF8_FormatError, pos, byte, len, getMemoryManager()); 183 183 } 184 184 … … 246 246 // 247 247 if (( *srcPtr == 0xE0) && ( *(srcPtr+1) < 0xA0)) 248 248 { 249 char byte0[2] = { *srcPtr ,0};250 char byte1[2] = { *(srcPtr+1),0};249 char byte0[2] = {static_cast<char>(*srcPtr), 0}; 250 char byte1[2] = {static_cast<char>(*(srcPtr+1)),0}; 251 251 252 252 ThrowXMLwithMemMgr2(UTFDataFormatException 253 253 , XMLExcepts::UTF8_Invalid_3BytesSeq … … 284 284 285 285 if ((*srcPtr == 0xED) && (*(srcPtr+1) >= 0xA0)) 286 286 { 287 char byte0[2] = { *srcPtr, 0};288 char byte1[2] = { *(srcPtr+1),0};287 char byte0[2] = {static_cast<char>(*srcPtr), 0}; 288 char byte1[2] = {static_cast<char>(*(srcPtr+1)),0}; 289 289 290 290 ThrowXMLwithMemMgr2(UTFDataFormatException 291 291 , XMLExcepts::UTF8_Irregular_3BytesSeq … … 310 310 if (((*srcPtr == 0xF0) && (*(srcPtr+1) < 0x90)) || 311 311 ((*srcPtr == 0xF4) && (*(srcPtr+1) > 0x8F)) ) 312 312 { 313 char byte0[2] = { *srcPtr ,0};314 char byte1[2] = { *(srcPtr+1),0};313 char byte0[2] = {static_cast<char>(*srcPtr), 0}; 314 char byte1[2] = {static_cast<char>(*(srcPtr+1)),0}; 315 315 316 316 ThrowXMLwithMemMgr2(UTFDataFormatException 317 317 , XMLExcepts::UTF8_Invalid_4BytesSeq … … 344 344 * surrogates, nor U+FFFE and U+FFFF (but it does allow other noncharacters). 345 345 ***/ 346 346 char len[2] = {(char)(trailingBytes+0x31), 0}; 347 char byte[2] = { *srcPtr,0};347 char byte[2] = {static_cast<char>(*srcPtr),0}; 348 348 349 349 ThrowXMLwithMemMgr2(UTFDataFormatException 350 350 , XMLExcepts::UTF8_Exceeds_BytesLimit