From a8e3af907caef4746af4d55e511d393bbe9de347 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Mon, 31 Oct 2011 20:59:49 +0100 Subject: [PATCH] Fix 'char' not always defaulting to sign. "Serge E. Hallyn" reports he has an ARM computer where 'char' defaults to 'unsigned char'. The correct return type of getopt() according to getopt(3) is 'int' though. --- ykchalresp.c | 2 +- ykpers-args.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ykchalresp.c b/ykchalresp.c index 2fabfbb..e7b6923 100644 --- a/ykchalresp.c +++ b/ykchalresp.c @@ -80,7 +80,7 @@ int parse_args(int argc, char **argv, bool *hmac, bool *may_block, int *exit_code) { - char c; + int c; bool hex_encoded = false; while((c = getopt(argc, argv, optstring)) != -1) { diff --git a/ykpers-args.c b/ykpers-args.c index 6d8620c..85e5ff4 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -197,7 +197,7 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, bool *aesviahash, int *exit_code) { - char c; + int c; const char *aeshash = NULL; bool new_access_code = false; bool slot_chosen = false; -- 2.39.5