HomeFreeBSD

Fix the calculations of the length of the unread message buffer

Description

Fix the calculations of the length of the unread message buffer
contents. The code was subtracting two unsigned ints, stored the
result in a log and expected it to be the same as of a signed
subtraction; this does only work on platforms where int and long
have the same size (due to overflows).
Instead, cast to long before the subtraction; the numbers are
guaranteed to be small enough so that there will be no overflows
because of that.

Details

Provenance
Thomas Moestl <tmm@FreeBSD.org>Authored on Oct 20 2002, 11:13 PM
Parents
rG72d26fe4c9a6: Use more verbose diagnostics for wrong DIGIT range
Branches
Unknown
Tags
Unknown

Event Timeline