diff options
Diffstat (limited to 'networking')
-rw-r--r-- | networking/traceroute.c | 10 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 3 | ||||
-rw-r--r-- | networking/wget.c | 3 |
3 files changed, 4 insertions, 12 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c index e9df275..6a53734 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c @@ -1001,17 +1001,11 @@ int traceroute_main(int argc, char **argv) #if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE if (source_route_list) { - llist_t *l_sr; - - l_sr = source_route_list; - while (l_sr) { + while (source_route_list) { if (lsrr >= NGATEWAYS) bb_error_msg_and_die("no more than %d gateways", NGATEWAYS); - getaddr(gwlist + lsrr, l_sr->data); + getaddr(gwlist + lsrr, llist_pop(&source_route_list)); ++lsrr; - l_sr = l_sr->link; - free(source_route_list); - source_route_list = l_sr; } optlen = (lsrr + 1) * sizeof(gwlist[0]); } diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 655d39f..5eb1ed5 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -259,12 +259,11 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSED, char **argv) if (opt & OPT_o) client_config.no_default_options = 1; while (list_O) { - int n = index_in_strings(dhcp_option_strings, list_O->data); + int n = index_in_strings(dhcp_option_strings, llist_pop(&list_O)); if (n < 0) bb_error_msg_and_die("unknown option '%s'", list_O->data); n = dhcp_options[n].code; client_config.opt_mask[n >> 3] |= 1 << (n & 7); - list_O = list_O->link; } if (read_interface(client_config.interface, &client_config.ifindex, diff --git a/networking/wget.c b/networking/wget.c index 84ee1ca..7198197 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -469,8 +469,7 @@ int wget_main(int argc ATTRIBUTE_UNUSED, char **argv) } extra_headers = cp = xmalloc(size); while (headers_llist) { - cp += sprintf(cp, "%s\r\n", headers_llist->data); - headers_llist = headers_llist->link; + cp += sprintf(cp, "%s\r\n", (char*)llist_pop(&headers_llist)); } } #endif |