nvramtool: fix getopt handling with unsigned char
make failed while executing "OPTION option_table.h" by printing nvramtool's usage message when crosscompiling coreboot on the BBB. The reason is the usage of char for the return value of getopt instead of int and comparing it to -1 later... although char might be unsigned as it is usually on ARM. Change-Id: Ib20fd5ef174d484bbb35f80150b8f898d95d0fe4 Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at> Reviewed-on: http://review.coreboot.org/9307 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
362f048979
commit
1f5349e61d
|
@ -51,8 +51,7 @@ static const char getopt_string[] = "-ab:B:c::C:dD:e:hH:iL:l::np:r:tvw:xX:y:Y";
|
||||||
void parse_nvramtool_args(int argc, char *argv[])
|
void parse_nvramtool_args(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
nvramtool_op_modifier_info_t *mod_info;
|
nvramtool_op_modifier_info_t *mod_info;
|
||||||
int i, op_found;
|
int i, op_found, c;
|
||||||
char c;
|
|
||||||
|
|
||||||
for (i = 0, mod_info = nvramtool_op_modifiers;
|
for (i = 0, mod_info = nvramtool_op_modifiers;
|
||||||
i < NVRAMTOOL_NUM_OP_MODIFIERS; i++, mod_info++) {
|
i < NVRAMTOOL_NUM_OP_MODIFIERS; i++, mod_info++) {
|
||||||
|
|
Loading…
Reference in New Issue