• Vasil Dimov's avatar
    Fix BUG#11798085 - INCORRECT INTEGER TYPES USED IN CALCULATION RESULT · 5a805fe7
    Vasil Dimov authored
    IN OVERFLOW
    
    Do not assign the result of the difference to a signed variable and
    checking whether it is negative afterwards because this limits the max diff
    to 2G on 32 bit systems. E.g. "signed = 3.5G - 1G" would be negative and the
    code would assume that 3.5G < 1G. Instead compare the two variables directly
    and assign to unsigned only if we know that the result of the subtraction
    will be positive.
    
    Discussed with:	Jimmy and Sunny (via IRC)
    5a805fe7
buf0buf.c 111 KB