mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-13 20:58:16 +03:00
Fix a schema type duration comparison overflow
https://bugzilla.gnome.org/show_bug.cgi?id=653724 Based on the fix suggested by Nick Pope <nick@nickpope.me.uk> but just changing the casts to avoid using long long type
This commit is contained in:
parent
7dd0d916c6
commit
bbcf1275fe
@ -3569,8 +3569,8 @@ xmlSchemaCompareDurations(xmlSchemaValPtr x, xmlSchemaValPtr y)
|
||||
|
||||
/* seconds */
|
||||
sec = x->value.dur.sec - y->value.dur.sec;
|
||||
carry = (long)sec / SECS_PER_DAY;
|
||||
sec -= (double)(carry * SECS_PER_DAY);
|
||||
carry = (long)(sec / SECS_PER_DAY);
|
||||
sec -= ((double)carry) * SECS_PER_DAY;
|
||||
|
||||
/* days */
|
||||
day = x->value.dur.day - y->value.dur.day + carry;
|
||||
|
Loading…
x
Reference in New Issue
Block a user