diff options
author | plutooo <tfy12vbr@student.lu.se> | 2013-08-01 11:52:13 -0700 |
---|---|---|
committer | plutooo <tfy12vbr@student.lu.se> | 2013-08-01 11:54:06 -0700 |
commit | 3d916b35f2dadd17a7c9f5acd08ef396b8c8263c (patch) | |
tree | cf0fcbc0a51c0c02e4949e3cd4e8822b41bf5af8 /testing | |
parent | d534a052648cc0085d6d6e40c22701e2feb5b416 (diff) |
core: getaddrinfo() lookup error handling
Diffstat (limited to 'testing')
-rw-r--r-- | testing/nTox.c | 2 | ||||
-rw-r--r-- | testing/nTox_win32.c | 4 | ||||
-rw-r--r-- | testing/toxic/prompt.c | 4 |
3 files changed, 5 insertions, 5 deletions
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[]) | |||
423 | IP_Port bootstrap_ip_port; | 423 | IP_Port bootstrap_ip_port; |
424 | bootstrap_ip_port.port = htons(atoi(argv[2])); | 424 | bootstrap_ip_port.port = htons(atoi(argv[2])); |
425 | int resolved_address = resolve_addr(argv[1]); | 425 | int resolved_address = resolve_addr(argv[1]); |
426 | if (resolved_address != -1) | 426 | if (resolved_address != 0) |
427 | bootstrap_ip_port.ip.i = resolved_address; | 427 | bootstrap_ip_port.ip.i = resolved_address; |
428 | else | 428 | else |
429 | exit(1); | 429 | 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[]) | |||
346 | IP_Port bootstrap_ip_port; | 346 | IP_Port bootstrap_ip_port; |
347 | bootstrap_ip_port.port = htons(atoi(argv[2])); | 347 | bootstrap_ip_port.port = htons(atoi(argv[2])); |
348 | int resolved_address = resolve_addr(argv[1]); | 348 | int resolved_address = resolve_addr(argv[1]); |
349 | if (resolved_address != -1) | 349 | if (resolved_address != 0) |
350 | bootstrap_ip_port.ip.i = resolved_address; | 350 | bootstrap_ip_port.ip.i = resolved_address; |
351 | else | 351 | else |
352 | exit(1); | 352 | exit(1); |
@@ -384,4 +384,4 @@ int main(int argc, char *argv[]) | |||
384 | Sleep(1); | 384 | Sleep(1); |
385 | } | 385 | } |
386 | return 0; | 386 | return 0; |
387 | } \ No newline at end of file | 387 | } |
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) { | |||
83 | 83 | ||
84 | dht.port = htons(atoi(port)); | 84 | dht.port = htons(atoi(port)); |
85 | 85 | ||
86 | int resolved_address = resolve_addr(ip); | 86 | uint32_t resolved_address = resolve_addr(ip); |
87 | if (resolved_address == -1) { | 87 | if (resolved_address == 0) { |
88 | return; | 88 | return; |
89 | } | 89 | } |
90 | 90 | ||