Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/rofl0r/proxychains-ng.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2018-12-02 16:45:35 +0300
committerrofl0r <retnyg@gmx.net>2018-12-02 16:45:35 +0300
commitbd7e8a1da12d2931074dfeae5e21dc0dae5eadb3 (patch)
treeea2882348e32e25b8fdee1bff94f9e25e55c6290
parent416d481ac9689853cd01bbd433ae3c9e0483eea9 (diff)
test_getaddrinfo.c: add check for service argument
-rw-r--r--tests/test_getaddrinfo.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_getaddrinfo.c b/tests/test_getaddrinfo.c
index 8fd62f7..179b43b 100644
--- a/tests/test_getaddrinfo.c
+++ b/tests/test_getaddrinfo.c
@@ -8,13 +8,13 @@
#define NI_MAXHOST 1025
#endif
-int main(void) {
+static int doit(const char* host, const char* service) {
struct addrinfo *result;
struct addrinfo *res;
int error;
/* resolve the domain name into a list of addresses */
- error = getaddrinfo("www.example.com", NULL, NULL, &result);
+ error = getaddrinfo(host, service, NULL, &result);
if (error != 0)
{
fprintf(stderr, "error in getaddrinfo: %s\n", gai_strerror(error));
@@ -39,3 +39,10 @@ int main(void) {
freeaddrinfo(result);
return EXIT_SUCCESS;
}
+
+int main(void) {
+ int ret;
+ ret = doit("www.example.com", NULL);
+ ret = doit("www.example.com", "80");
+ return ret;
+}