From: Fredrik Thulin Date: Mon, 31 Oct 2011 19:59:49 +0000 (+0100) Subject: Fix 'char' not always defaulting to sign. X-Git-Tag: v1.6.2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8e3af907caef4746af4d55e511d393bbe9de347;p=yubikey-personalization.old 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. --- 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;