diff options
author | Luis Ressel <aranea@aixah.de> | 2019-03-23 01:31:19 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-03-23 12:50:52 +0100 |
commit | 9a0fc56cdb72271ca75c2e4f7204cbe817c53488 (patch) | |
tree | a9d8b1343d594420300a0d1a0deb909078298bdc /src/tools | |
parent | wg-quick: add 'strip' subcommand (diff) | |
download | wireguard-monolithic-historical-9a0fc56cdb72271ca75c2e4f7204cbe817c53488.tar.xz wireguard-monolithic-historical-9a0fc56cdb72271ca75c2e4f7204cbe817c53488.zip |
tools: avoid unneccessary next_peer assignments in sort_peers()
Signed-off-by: Luis Ressel <aranea@aixah.de>
Diffstat (limited to '')
-rw-r--r-- | src/tools/show.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/show.c b/src/tools/show.c index 4cc34ab..ff0897d 100644 --- a/src/tools/show.c +++ b/src/tools/show.c @@ -60,11 +60,10 @@ static void sort_peers(struct wgdevice *device) peers[i++] = peer; qsort(peers, peer_count, sizeof(*peers), peer_cmp); device->first_peer = peers[0]; - peers[0]->next_peer = NULL; for (i = 1; i < peer_count; ++i) { peers[i - 1]->next_peer = peers[i]; - peers[i]->next_peer = NULL; } + peers[peer_count - 1]->next_peer = NULL; free(peers); } |