cccb8b1d22a18031fc92d93133c7fa14ef7e1361 fixed an integer overflow in a
`memcmp`-/`strcmp`-like comparator. The same situation exists in the code
touched in this commit. Rather than wait for an edge case to expose an overflow
here, this change makes the same update, removing arithmetic and the consequent
possibility of overflow.
(void)d;
(void)disc;
- return (*p1 - *p2);
+ if (*p1 < *p2) {
+ return -1;
+ }
+ if (*p1 > *p2) {
+ return 1;
+ }
+ return 0;
}
static void *newIpair(Dt_t * d, Ipair * objp, Dtdisc_t * disc)