From fcc6347976ded376c9effe3b9fb216b00b2140cb Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 10 Apr 2008 02:09:40 +0000 Subject: udhcp,ipcalc: simple code shrink (Nico Erfurth ) function old new delta ipcalc_main 609 610 +1 read_staticlease 102 85 -17 ether_aton 17 - -17 --- networking/ipcalc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'networking/ipcalc.c') diff --git a/networking/ipcalc.c b/networking/ipcalc.c index 9e92b643e..8578893af 100644 --- a/networking/ipcalc.c +++ b/networking/ipcalc.c @@ -175,16 +175,13 @@ int ipcalc_main(int argc, char **argv) if (opt & HOSTNAME) { struct hostent *hostinfo; - int x; hostinfo = gethostbyaddr((char *) &ipaddr, sizeof(ipaddr), AF_INET); if (!hostinfo) { bb_herror_msg_and_die("cannot find hostname for %s", argv[0]); } - for (x = 0; hostinfo->h_name[x]; x++) { - hostinfo->h_name[x] = tolower(hostinfo->h_name[x]); - } - + str_tolower(hostinfo->h_name); + printf("HOSTNAME=%s\n", hostinfo->h_name); } } -- cgit v1.2.3