diff --git a/main.cpp b/main.cpp index 98e9549..349603f 100644 --- a/main.cpp +++ b/main.cpp @@ -29,8 +29,12 @@ int main(int /*argc*/, char** /*argv*/) { memset(&jch_addr, 0, sizeof(jch_addr)); jch_addr.sin6_family = AF_INET6; jch_addr.sin6_port = csts::DEFAULT_PORT; - if(inet_pton(AF_INET6, "::ffff::81.194.27.155", &jch_addr.sin6_addr)) { - perror("Cannot convert JCh address"); + int rc = inet_pton(AF_INET6, "::FFFF:81.194.27.155", &jch_addr.sin6_addr); + if(rc != 1) { + if(rc == 0) + fprintf(stderr, "Address uses an invalid format.\n"); + else + perror("Cannot convert JCh address"); exit(1); }