X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/99817f2e4d0ceaf8d3be1410c0c29fcd070ac6ec..b54c3cca7632b31faf33e57f35631e9589551e1a:/test/getcanon.c diff --git a/test/getcanon.c b/test/getcanon.c index ada6802a..27077dc6 100644 --- a/test/getcanon.c +++ b/test/getcanon.c @@ -1,17 +1,16 @@ -/* - * getcanon.c - Print the canonical name of a host, default to localhost. +/* getcanon.c - Print the canonical name of a host, default to localhost. * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ -#include /* for getaddrinfo */ +#include #include #include -#include /* for gethostname */ -#include /* for _POSIX_HOST_NAME_MAX */ -#include /* for memset */ +#include +#include +#include #include #include @@ -46,10 +45,10 @@ main(int argc, char *argv[]) hints.ai_family = AF_UNSPEC; if (getaddrinfo(hostname, NULL, &hints, &res)) { - printf("%s\n", hostname); + puts(hostname); return 1; } - printf("%s\n", res->ai_canonname); + puts(res->ai_canonname); return 0; }