There is no eloquent way to exclude/include arch dependent arguments
from the ul_excl_t array. So when an arch dependent argument is left
undefined err_exclusive_options() was printing out-of-bounds values.
This commit cause them to be skipped instead.
err_exclusive_options() shouldn't be printing out-of-bounds values
in any case.
Also change the error massage from 'options' to 'arguments' as some
programs, like hwclock, distinguish between options and functions.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
./include/optutils.h:12:18: warning: null pointer dereference [-Wnull-dereference]
for (o = opts; o->name; o++)
~^~~~~~
In file included from libfdisk/src/dos.c:12:0:
./include/pt-mbr.h:25:47: warning: potential null pointer dereference [-Wnull-dereference]
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
~^~~
Well these should be impossible, so add assert() to catch possible bugs.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This is improved implementation of exclusive_option(). The new
implementation:
- uses regular struct option to compose error messages
- relationships between options are described in one const static array
- the current status is stored in one int array
Signed-off-by: Karel Zak <kzak@redhat.com>