X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fshowmount%2Fshowmount.c;h=8fb58a2c2e1c13c6936a8cdfea9b64b785d56ece;hp=47b58255a285a2af1338c59f2d6f8ea5bd54f3b5;hb=3419e37500dfd19cb2c246260dbd2bc0ee4704d4;hpb=8b7ad01b14df1e7529b9ba8a1ea17df0d6004ef9 diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c index 47b5825..8fb58a2 100644 --- a/utils/showmount/showmount.c +++ b/utils/showmount/showmount.c @@ -13,7 +13,9 @@ * GNU General Public License for more details. */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif #include #include @@ -154,9 +156,8 @@ char **argv; break; } - if (hostname[0] >= '0' && hostname[0] <= '9') { + if (inet_aton(hostname, &server_addr.sin_addr)) { server_addr.sin_family = AF_INET; - server_addr.sin_addr.s_addr = inet_addr(hostname); } else { if ((hp = gethostbyname(hostname)) == NULL) {