jdp a8fdb15db6 Fix a range checking bug in ng_int32_parse which affected 64-bit
machines.  The code formerly read:

    long val;
    if (val < (long)-0x80000000 || ...)
            return EINVAL;

The constant 0x80000000 has type unsigned int.  The unary `-'
operator does not change the type (or the value, in this case).
Therefore the promotion to long is done by 0-extension, giving
0x0000000080000000 instead of the desired 0xffffffff80000000.  I
got rid of the `-' and changed the cast to (int32_t) to give proper
sign-extension on all architectures and to better reflect the fact
that we are range-checking a 32-bit value.

This commit also makes the analogous changes to ng_int{8,16}_parse
for consistency.

MFC after:	3 days
2001-05-19 19:36:32 +00:00
..
2001-03-28 09:17:56 +00:00
2001-01-10 07:13:58 +00:00
2001-03-10 16:31:00 +00:00
2001-01-30 07:58:30 +00:00
2001-01-30 07:58:30 +00:00
2001-01-10 07:13:58 +00:00
2001-01-08 05:34:06 +00:00
2001-01-08 05:34:06 +00:00
2001-02-25 16:49:04 +00:00
2001-01-08 05:34:06 +00:00
2001-01-10 07:13:58 +00:00
2001-01-10 07:13:58 +00:00
2001-01-10 07:13:58 +00:00
2001-01-10 07:13:58 +00:00
2001-01-09 00:49:31 +00:00
2001-01-08 05:34:06 +00:00
2001-01-08 05:34:06 +00:00