summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@gmx.at>2015-04-05 23:13:53 +0200
committerStefan Tauner <stefan.tauner@gmx.at>2015-04-06 23:29:06 +0200
commit1f5349e61d8aea950d6a197d11b0aa730aa80ee6 (patch)
tree58c26f8bcd4ef3fcc64d71a08d333548d0f6f2f5 /util
parent362f048979e64d57a4bed330040e2eb421cd4fae (diff)
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>
Diffstat (limited to 'util')
-rw-r--r--util/nvramtool/cli/opts.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/nvramtool/cli/opts.c b/util/nvramtool/cli/opts.c
index 8e920e8694..a128c0be31 100644
--- a/util/nvramtool/cli/opts.c
+++ b/util/nvramtool/cli/opts.c
@@ -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[])
{
nvramtool_op_modifier_info_t *mod_info;
- int i, op_found;
- char c;
+ int i, op_found, c;
for (i = 0, mod_info = nvramtool_op_modifiers;
i < NVRAMTOOL_NUM_OP_MODIFIERS; i++, mod_info++) {