]> err.no Git - yubikey-personalization/commitdiff
Fix 'char' not always defaulting to sign.
authorFredrik Thulin <fredrik@yubico.com>
Mon, 31 Oct 2011 19:59:49 +0000 (20:59 +0100)
committerFredrik Thulin <fredrik@yubico.com>
Mon, 31 Oct 2011 19:59:49 +0000 (20:59 +0100)
"Serge E. Hallyn" <serge.hallyn@canonical.com> 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
ykpers-args.c

index 2fabfbb2da2366806b226cc220ecb9de85dccf41..e7b69231abb7706ae10ff6485a8d0a10a98736ad 100644 (file)
@@ -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) {
index 6d8620c245e1d5baf31b9bf3f1358a924d6431ad..85e5ff4d6618a566c8085c46e61b095672e116c2 100644 (file)
@@ -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;