Fix comparator for overflow check
This commit is contained in:
parent
b21fa8a57f
commit
a1157f7b8b
@ -26,7 +26,7 @@ utf16_to_utf32(uint32_t *out,
|
|||||||
*out++ = code;
|
*out++ = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SSIZE_MAX - 1 <= rc)
|
if(SSIZE_MAX - 1 >= rc)
|
||||||
++rc;
|
++rc;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -39,7 +39,7 @@ utf16_to_utf8(uint8_t *out,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SSIZE_MAX - units <= rc)
|
if(SSIZE_MAX - units >= rc)
|
||||||
rc += units;
|
rc += units;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -26,7 +26,7 @@ utf32_to_utf16(uint16_t *out,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SSIZE_MAX - units <= rc)
|
if(SSIZE_MAX - units >= rc)
|
||||||
rc += units;
|
rc += units;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -30,7 +30,7 @@ utf32_to_utf8(uint8_t *out,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SSIZE_MAX - units <= rc)
|
if(SSIZE_MAX - units >= rc)
|
||||||
rc += units;
|
rc += units;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -35,7 +35,7 @@ utf8_to_utf16(uint16_t *out,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SSIZE_MAX - units <= rc)
|
if(SSIZE_MAX - units >= rc)
|
||||||
rc += units;
|
rc += units;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -26,7 +26,7 @@ utf8_to_utf32(uint32_t *out,
|
|||||||
*out++ = code;
|
*out++ = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SSIZE_MAX - 1 <= rc)
|
if(SSIZE_MAX - 1 >= rc)
|
||||||
++rc;
|
++rc;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user