Skip to content

Commit

Permalink
further 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 e23c26d commit d811f73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions databases/lib/libipv6calc_db_wrapper_IP2Location.c
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ uint32_t libipv6calc_db_wrapper_IP2Location_wrapper_asn_by_addr(const ipv6calc_i
char *IP2Location_result_ptr = NULL;
unsigned int IP2Location_type = 0;

long asn;
long long asn;
char *end;

if (ipaddrp->proto == IPV6CALC_PROTO_IPV4) {
Expand Down Expand Up @@ -2237,7 +2237,7 @@ uint32_t libipv6calc_db_wrapper_IP2Location_wrapper_asn_by_addr(const ipv6calc_i
};

errno = 0;
asn = strtol(IP2Location_result_ptr, &end, 10);
asn = strtoll(IP2Location_result_ptr, &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", IP2Location_result_ptr);
Expand Down

0 comments on commit d811f73

Please sign in to comment.