From: Klas Lindfors Date: Tue, 4 Dec 2012 13:47:18 +0000 (+0100) Subject: more general way of setting mode bits for usb_mode X-Git-Tag: v1.10.0~17 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd97adcb1d6ae7f7f28db4c918e0f0ea5348e9ab;p=yubikey-personalization more general way of setting mode bits for usb_mode --- diff --git a/ykpers-args.c b/ykpers-args.c index 1dfcdf9..852cf8d 100644 --- a/ykpers-args.c +++ b/ykpers-args.c @@ -442,8 +442,8 @@ int args_to_config(int argc, char **argv, YKP_CONFIG *cfg, YK_KEY *yk, *exit_code = 1; return 0; } - if(optarg[0] == '8') { - *usb_mode |= 0x80; + if(optarg[1] != '\n') { + *usb_mode = (optarg[0] - '0') << 4; optarg++; } if(optarg[1] == '\0') {