On Wed, Mar 13, 2013 at 05:02:02PM +0100, Peter Stuge wrote:
It avoids the problem, but why is it safe?
The mere possibility that the counter can become negative suggests
an imbalance somewhere in the code - but I don't know if that's the
case, which is why I ask.
Exactly, the point is that the current code is broken. And in general
using OSMO_MIN/OSMO_MAX is better than hand rolling code. And if a range
is from a to b it is better to clamp it on both sides that just one.
For this specific issue. I wouldn't mind making the value '0' illegal,
GSM 12.21 doesn't specify the legal range and as '0' and '1' will
behave
the same with the fixed code it does make sense to forbid '0'.
Anyway, the current code is broken so Andreas please fix it ASAP.
holger