Download raw body.
ctfconv fix it_cmp function
That looks better indeed. It is almost never safe to use subtraction
in a compare function. Even for plain int it is possible to have
signed integer overflow, which is undefined behavior.
The only safe patterns are:
int ret = a > b ? 1 : a < b ? -1 : 0;
or:
int ret = (a > b) - (a < b);
Personally, I prefer an expanded version of the first one, as you
chose to do.
OK millert@
- todd
ctfconv fix it_cmp function