Use inet_pton instead of inet_aton

This exists on all platforms, no messy #ifdef needed.
This commit is contained in:
Mike Swanson
2026-02-06 17:58:42 -08:00
parent 85e4122f9f
commit 441f396ca1
2 changed files with 0 additions and 8 deletions

View File

@@ -896,11 +896,7 @@ load_network(void)
p = ini_section_get_string(cat, temp, "");
if (p && *p) {
struct in_addr addr;
#ifdef _WIN32
if (inet_aton(p, &addr)) {
#else
if (inet_pton(AF_INET, p, &addr)) {
#endif
uint8_t *bytes = (uint8_t *)&addr.s_addr;
bytes[3] = 0;
sprintf(nc->slirp_net, "%d.%d.%d.0", bytes[0], bytes[1], bytes[2]);