aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ipcalc.c5
1 files changed, 5 insertions, 0 deletions
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 <ctype.h>
#include <popt.h>
#include <stdio.h>
#include <sys/socket.h>
@@ -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);
}