mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
Fix integer conversion warnings in xmlstring.c
Use an int to avoid an integer conversion warning with UBSan when left-shifting a char.
This commit is contained in:
@@ -835,7 +835,7 @@ xmlCheckUTF8(const unsigned char *utf)
|
||||
int
|
||||
xmlUTF8Strsize(const xmlChar *utf, int len) {
|
||||
const xmlChar *ptr=utf;
|
||||
xmlChar ch;
|
||||
int ch;
|
||||
|
||||
if (utf == NULL)
|
||||
return(0);
|
||||
@@ -896,7 +896,7 @@ xmlUTF8Strndup(const xmlChar *utf, int len) {
|
||||
*/
|
||||
const xmlChar *
|
||||
xmlUTF8Strpos(const xmlChar *utf, int pos) {
|
||||
xmlChar ch;
|
||||
int ch;
|
||||
|
||||
if (utf == NULL) return(NULL);
|
||||
if (pos < 0)
|
||||
@@ -929,7 +929,7 @@ xmlUTF8Strpos(const xmlChar *utf, int pos) {
|
||||
int
|
||||
xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
|
||||
int i, size;
|
||||
xmlChar ch;
|
||||
int ch;
|
||||
|
||||
if (utf==NULL || utfchar==NULL) return -1;
|
||||
size = xmlUTF8Strsize(utfchar, 1);
|
||||
@@ -966,7 +966,7 @@ xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
|
||||
xmlChar *
|
||||
xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
|
||||
int i;
|
||||
xmlChar ch;
|
||||
int ch;
|
||||
|
||||
if (utf == NULL) return(NULL);
|
||||
if (start < 0) return(NULL);
|
||||
|
Reference in New Issue
Block a user