Skip to content

Commit

Permalink
fix for 32-bit systems
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiering committed Jun 12, 2023
1 parent bde5a64 commit e23c26d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions databases/lib/libipv6calc_db_wrapper_IP2Location.c
Original file line number Diff line number Diff line change
Expand Up @@ -2497,7 +2497,7 @@ int libipv6calc_db_wrapper_IP2Location_all_by_addr(const ipv6calc_ipaddr *ipaddr
IP2LocationRecord *record = NULL;

#if API_VERSION_NUMERIC >= 80600
long asn;
long long asn;
char *end;
#endif // API_VERSION_NUMERIC >= 80600

Expand Down Expand Up @@ -2640,12 +2640,12 @@ int libipv6calc_db_wrapper_IP2Location_all_by_addr(const ipv6calc_ipaddr *ipaddr

if (TEST_IP2LOCATION_AVAILABLE(record->asn)) {
errno = 0;
asn = strtol(record->asn, &end, 10);
asn = strtoll(record->asn, &end, 10);

if ((errno == ERANGE) || (asn < 0) || (asn > UINT32_MAX)) {
DEBUGPRINT_WA(DEBUG_libipv6calc_db_wrapper_IP2Location, "can't convert AS number string to uint32_t as out-of-range: %s", record->asn);
} else {
recordp->asn = asn;
recordp->asn = (uint32_t) asn;
};
};

Expand Down

0 comments on commit e23c26d

Please sign in to comment.