chrislim2888 / IP2Location-C-Library

IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
https://www.ip2location.com
MIT License
61 stars 30 forks source link

Simplify logic and prevent fd & memory leak #61

Closed lytboris closed 9 months ago

lytboris commented 9 months ago
if (condition) {
    //noop
} else {
    action;
}

is hard to understand so we simplify it with return early. Also we prevent fd and memory allocation leak as well.