mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 01:48:21 -07:00
Use inet_pton instead of inet_aton
This exists on all platforms, no messy #ifdef needed.
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user