networking: fix potential overflow in ife_print6()

devname is used by fscanf to store a string specified by '%20s'.

Extract from the man for the '%s' specifier:
Matches a sequence of non-white-space characters; the next pointer must be a
pointer to character array that is long enough to hold the input sequence and
the terminating null byte ('\0'), which is added automatically. The input
string stops at white space or at the maximum field width, whichever occurs
first.

Hence, the right length is 20 + 1 for the '\0'.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
fix build error with musl libc due to if_slip.h

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
tar: fix tar -T to add entries in the exact order as the input list

This fixes tar to order files in tarball correctly in this case:

$ touch 1 2 3; echo -e '1\n2\n3' | tar -T- -c | tar t
1
2
3

Signed-off-by: SASAKI Suguru <suguru@sonik.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
init: don't use fixed size buffer for command

We store init actions forever. 256 bytes per action means that
a typical inittab of ~10 commands uses 2.5k just to remember
command strings - which are usually _much_ shorter than 256 bytes.

At a cost of a bit more code, it's possible to allocate
only actually needed amount.

function                                             old     new   delta
init_exec                                            224     248     +24
new_init_action                                      140     142      +2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
init: don't srop unterminated processes' entries during inittab reload

This feature was removed in 72c99af

It is useful when process is removed from inittab and later added
back, but never terminated. It prevents init from spawning duplicate.

function                                             old     new   delta
check_delayed_sigs                                   176     182      +6

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
iplink: comment out include <net/if_packet.h>

iplink.c includes net/if_packet.h, which (on GLIBC)
only defines struct sockaddr_pkt. this struct is not
used anywhere in the code, and removing the #include
makes compilation succeed with musl libc.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: do not reuse local variables for unrelated values.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: support conv=swab

function                                             old     new   delta
dd_main                                             1482    1520     +38
static.conv_words                                     28      33      +5
packed_usage                                       29377   29375      -2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: fix example in a comment. No code changes.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
lineedit: improve Unicode handling (still buggy though)

function                                             old     new   delta
unicode_strlen                                         -      31     +31
read_line_input                                     3876    3879      +3
lineedit_read_key                                    255     246      -9
parse_and_put_prompt                                 785     755     -30
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/2 up/down: 34/-39)             Total: -5 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
lineedit: fix multi-line PS1 handling: calculate PS1 length from last \n

function                                             old     new   delta
parse_and_put_prompt                                 755     774     +19

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: fail if swab is attempted on odd-sized block

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: code shrink

function                                             old     new   delta
dd_main                                             1001     961     -40

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: remove FIXME comment which is fixed now. No code changes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: code shrink

function                                             old     new   delta
write_and_stats                                       78      99     +21
dd_main                                             1496    1487      -9
full_write_or_warn                                    42       -     -42
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 21/-51)            Total: -30 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: code shrink

function                                             old     new   delta
dd_main                                             1487    1475     -12

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
dd: code shrink

function                                             old     new   delta
dd_main                                             1475    1469      -6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
lineedit: use unicode_strwidth instead of unicode_strlen

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
fdisk: fix GPT size math errors

Signed-off-by: Jody Bruchon <jody@jodybruchon.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
man: find posix man pages

Add the 0p/1p/3p sections to the search.

Signed-off-by: John Spencer <maillist-busybox@barfooze.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>