1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

parser: Move xmlSaturatedAdd to private header

This commit is contained in:
Nick Wellnhofer
2025-07-22 22:38:05 +02:00
parent e3daef5c78
commit 144ed959a5
3 changed files with 20 additions and 26 deletions

View File

@@ -697,11 +697,7 @@ xmlParserShrink(xmlParserCtxt *ctxt) {
if (res > 0) {
used -= res;
if ((res > ULONG_MAX) ||
(in->consumed > ULONG_MAX - (unsigned long)res))
in->consumed = ULONG_MAX;
else
in->consumed += res;
xmlSaturatedAddSizeT(&in->consumed, res);
}
xmlBufUpdateInput(buf->buffer, in, used);
@@ -732,11 +728,7 @@ xmlParserInputShrink(xmlParserInput *in) {
ret = xmlBufShrink(in->buf->buffer, used - LINE_LEN);
if (ret > 0) {
used -= ret;
if ((ret > ULONG_MAX) ||
(in->consumed > ULONG_MAX - (unsigned long)ret))
in->consumed = ULONG_MAX;
else
in->consumed += ret;
xmlSaturatedAddSizeT(&in->consumed, ret);
}
xmlBufUpdateInput(in->buf->buffer, in, used);