27 Apr
2010
27 Apr
'10
9:35 p.m.
Peter Lieven <pli@peering.eu> wrote on 2010/04/27 16:48:38:
You know what the fix is? a (int) type cast like so: x = (int)((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
Yes, i noticed that.
I'm totally not in sync with this thread, but are you sure, that you really want to do a modulo 255 operation and not modulo 256 ( & 0xff ) here?
How does that work with negative numbers?