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:
12
xmlstring.c
12
xmlstring.c
@@ -834,8 +834,8 @@ xmlCheckUTF8(const unsigned char *utf)
|
|||||||
|
|
||||||
int
|
int
|
||||||
xmlUTF8Strsize(const xmlChar *utf, int len) {
|
xmlUTF8Strsize(const xmlChar *utf, int len) {
|
||||||
const xmlChar *ptr=utf;
|
const xmlChar *ptr=utf;
|
||||||
xmlChar ch;
|
int ch;
|
||||||
|
|
||||||
if (utf == NULL)
|
if (utf == NULL)
|
||||||
return(0);
|
return(0);
|
||||||
@@ -896,7 +896,7 @@ xmlUTF8Strndup(const xmlChar *utf, int len) {
|
|||||||
*/
|
*/
|
||||||
const xmlChar *
|
const xmlChar *
|
||||||
xmlUTF8Strpos(const xmlChar *utf, int pos) {
|
xmlUTF8Strpos(const xmlChar *utf, int pos) {
|
||||||
xmlChar ch;
|
int ch;
|
||||||
|
|
||||||
if (utf == NULL) return(NULL);
|
if (utf == NULL) return(NULL);
|
||||||
if (pos < 0)
|
if (pos < 0)
|
||||||
@@ -929,7 +929,7 @@ xmlUTF8Strpos(const xmlChar *utf, int pos) {
|
|||||||
int
|
int
|
||||||
xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
|
xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
|
||||||
int i, size;
|
int i, size;
|
||||||
xmlChar ch;
|
int ch;
|
||||||
|
|
||||||
if (utf==NULL || utfchar==NULL) return -1;
|
if (utf==NULL || utfchar==NULL) return -1;
|
||||||
size = xmlUTF8Strsize(utfchar, 1);
|
size = xmlUTF8Strsize(utfchar, 1);
|
||||||
@@ -965,8 +965,8 @@ xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
|
|||||||
|
|
||||||
xmlChar *
|
xmlChar *
|
||||||
xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
|
xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
|
||||||
int i;
|
int i;
|
||||||
xmlChar ch;
|
int ch;
|
||||||
|
|
||||||
if (utf == NULL) return(NULL);
|
if (utf == NULL) return(NULL);
|
||||||
if (start < 0) return(NULL);
|
if (start < 0) return(NULL);
|
||||||
|
Reference in New Issue
Block a user