1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-09 02:22:18 +00:00
freebsd-ports/devel/uclmmbase/files/patch-af
2003-01-24 01:44:47 +00:00

26 lines
607 B
Plaintext

--- src/mbus_parser.c.orig Thu Jan 23 17:39:55 2003
+++ src/mbus_parser.c Thu Jan 23 17:41:26 2003
@@ -158,6 +158,7 @@
int mbus_parse_int(struct mbus_parser *m, int *i)
{
char *p;
+ long l;
assert(m->magic == MBUS_PARSER_MAGIC);
@@ -166,11 +167,12 @@
CHECK_OVERRUN;
}
- *i = strtol(m->buffer, &p, 10);
- if (((*i == LONG_MAX) || (*i == LONG_MIN)) && (errno == ERANGE)) {
+ l = strtol(m->buffer, &p, 10);
+ if (((l >= INT_MAX) || (l <= INT_MIN)) && (errno == ERANGE)) {
debug_msg("integer out of range\n");
return FALSE;
}
+ *i = l;
if (p == m->buffer) {
return FALSE;