From 3d916b35f2dadd17a7c9f5acd08ef396b8c8263c Mon Sep 17 00:00:00 2001 From: plutooo Date: Thu, 1 Aug 2013 11:52:13 -0700 Subject: core: getaddrinfo() lookup error handling --- testing/nTox.c | 2 +- testing/nTox_win32.c | 4 ++-- testing/toxic/prompt.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'testing') diff --git a/testing/nTox.c b/testing/nTox.c index 17f4b0e7..f87a2a25 100644 --- a/testing/nTox.c +++ b/testing/nTox.c @@ -423,7 +423,7 @@ int main(int argc, char *argv[]) IP_Port bootstrap_ip_port; bootstrap_ip_port.port = htons(atoi(argv[2])); int resolved_address = resolve_addr(argv[1]); - if (resolved_address != -1) + if (resolved_address != 0) bootstrap_ip_port.ip.i = resolved_address; else exit(1); diff --git a/testing/nTox_win32.c b/testing/nTox_win32.c index b9208d4f..2394877f 100644 --- a/testing/nTox_win32.c +++ b/testing/nTox_win32.c @@ -346,7 +346,7 @@ int main(int argc, char *argv[]) IP_Port bootstrap_ip_port; bootstrap_ip_port.port = htons(atoi(argv[2])); int resolved_address = resolve_addr(argv[1]); - if (resolved_address != -1) + if (resolved_address != 0) bootstrap_ip_port.ip.i = resolved_address; else exit(1); @@ -384,4 +384,4 @@ int main(int argc, char *argv[]) Sleep(1); } return 0; -} \ No newline at end of file +} diff --git a/testing/toxic/prompt.c b/testing/toxic/prompt.c index 3c4a27dd..a3cf2d94 100644 --- a/testing/toxic/prompt.c +++ b/testing/toxic/prompt.c @@ -83,8 +83,8 @@ static void execute(ToxWindow* self, char* cmd) { dht.port = htons(atoi(port)); - int resolved_address = resolve_addr(ip); - if (resolved_address == -1) { + uint32_t resolved_address = resolve_addr(ip); + if (resolved_address == 0) { return; } -- cgit v1.2.3