From 513953f9cca632e75f9e8f5b99b77a4e0758b411 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Tue, 30 Jan 2001 21:21:59 +0000 Subject: change hostnames to all lowercase (#9579) --- src/ipcalc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ipcalc.c b/src/ipcalc.c index b85f103e..922d2cc5 100644 --- a/src/ipcalc.c +++ b/src/ipcalc.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -98,6 +99,7 @@ int main(int argc, char ** argv) { } if (showHostname) { + int x; hostinfo = gethostbyaddr((char *) &ip, sizeof(ip), AF_INET); if (!hostinfo) { if (!beSilent) { @@ -107,6 +109,9 @@ int main(int argc, char ** argv) { return 1; } + for (x=0; hostinfo->h_name[x]; x++) { + hostinfo->h_name[x] = tolower(hostinfo->h_name[x]); + } printf("HOSTNAME=%s\n", hostinfo->h_name); } -- cgit v1.2.1