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
This commit is contained in:
Denis Vlasenko
2008-04-10 02:09:40 +00:00
parent b3f39f0cfa
commit fcc6347976
2 changed files with 3 additions and 8 deletions

View File

@ -26,13 +26,11 @@ static int read_ip(const char *line, void *arg)
static int read_mac(const char *line, void *arg)
{
uint8_t *mac_bytes = arg;
struct ether_addr *temp_ether_addr;
temp_ether_addr = ether_aton(line);
temp_ether_addr = ether_aton_r(line, (struct ether_addr *)arg);
if (temp_ether_addr == NULL)
return 0;
memcpy(mac_bytes, temp_ether_addr, 6);
return 1;
}