diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-10 02:09:40 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-10 02:09:40 +0000 |
commit | fcc6347976ded376c9effe3b9fb216b00b2140cb (patch) | |
tree | c21dd5062aeaafead13d6fa66b196f7f3fb4be46 /networking/ipcalc.c | |
parent | b3f39f0cfa766344cd1faec3de3c8812184a237f (diff) | |
download | busybox-w32-fcc6347976ded376c9effe3b9fb216b00b2140cb.tar.gz busybox-w32-fcc6347976ded376c9effe3b9fb216b00b2140cb.tar.bz2 busybox-w32-fcc6347976ded376c9effe3b9fb216b00b2140cb.zip |
udhcp,ipcalc: simple code shrink (Nico Erfurth <masta AT perlgolf.de>)
function old new delta
ipcalc_main 609 610 +1
read_staticlease 102 85 -17
ether_aton 17 - -17
Diffstat (limited to 'networking/ipcalc.c')
-rw-r--r-- | networking/ipcalc.c | 7 |
1 files changed, 2 insertions, 5 deletions
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) | |||
175 | 175 | ||
176 | if (opt & HOSTNAME) { | 176 | if (opt & HOSTNAME) { |
177 | struct hostent *hostinfo; | 177 | struct hostent *hostinfo; |
178 | int x; | ||
179 | 178 | ||
180 | hostinfo = gethostbyaddr((char *) &ipaddr, sizeof(ipaddr), AF_INET); | 179 | hostinfo = gethostbyaddr((char *) &ipaddr, sizeof(ipaddr), AF_INET); |
181 | if (!hostinfo) { | 180 | if (!hostinfo) { |
182 | bb_herror_msg_and_die("cannot find hostname for %s", argv[0]); | 181 | bb_herror_msg_and_die("cannot find hostname for %s", argv[0]); |
183 | } | 182 | } |
184 | for (x = 0; hostinfo->h_name[x]; x++) { | 183 | str_tolower(hostinfo->h_name); |
185 | hostinfo->h_name[x] = tolower(hostinfo->h_name[x]); | 184 | |
186 | } | ||
187 | |||
188 | printf("HOSTNAME=%s\n", hostinfo->h_name); | 185 | printf("HOSTNAME=%s\n", hostinfo->h_name); |
189 | } | 186 | } |
190 | } | 187 | } |