]> git.ipfire.org Git - thirdparty/mtr.git/commit
net: fix net_reopen() initialization 153/head
authorSami Kerola <kerolasa@iki.fi>
Sun, 2 Oct 2016 21:17:39 +0000 (22:17 +0100)
committerSami Kerola <kerolasa@iki.fi>
Tue, 4 Oct 2016 10:33:51 +0000 (11:33 +0100)
commit772afcec1f9d6c8d9790e0346d8b792df6735bb3
tree9b2a779326c1d88e2cfd5c8656370b9b27ece471
parente57d2806763e3858c6d0cc86731a4b7bf239b4a1
net: fix net_reopen() initialization

Mantas Mikulenas reviewed recent pull reques that contained commit
b90a522f23167bd00062504803e94220937aba23 making a code path quicker.
Unfortunately initialization was incomplete, as demonstrated by R.E.
Wolff in same review.  Fix is to use GCC designated initializer.

Reference: https://github.com/traviscross/mtr/pull/151
Reference: https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html

Review update.  Replace following initializer with an iterative loop.

  .saved = { [0 ... SAVED_PINGS - 1] = -2 },

This is done to keep compatibility with non-gcc compilers.

Reference: https://github.com/traviscross/mtr/pull/153
net.c