diff --git a/util.c b/util.c index 29e91b1..858c9d9 100644 --- a/util.c +++ b/util.c @@ -212,8 +212,8 @@ static int parse_native_format(const cfg_t *cfg, const char *username, FILE *opwfile, device_t *devices, unsigned *n_devs) { - char *s_user, *s_credential; - char *buf = NULL; + const char *s_user; + char *buf = NULL, *s_credential; size_t bufsiz = 0; ssize_t len; unsigned i; @@ -786,7 +786,6 @@ void free_devices(device_t *devices, const unsigned n_devs) { } free(devices); - devices = NULL; } static int get_authenticators(const cfg_t *cfg, const fido_dev_info_t *devlist, @@ -885,13 +884,14 @@ static void parse_opts(const cfg_t *cfg, const char *attr, struct opts *opts) { static int get_device_opts(fido_dev_t *dev, int *pin, int *uv) { fido_cbor_info_t *info = NULL; - char *const *ptr; const bool *val; - size_t len; *pin = *uv = -1; /* unsupported */ if (fido_dev_is_fido2(dev)) { + char *const *ptr; + size_t len; + if ((info = fido_cbor_info_new()) == NULL || fido_dev_get_cbor_info(dev, info) != FIDO_OK) { fido_cbor_info_free(&info); @@ -1423,7 +1423,7 @@ int do_manual_authentication(const cfg_t *cfg, const device_t *devices, debug_dbg(cfg, "Challenge: %s", b64_challenge); - n = snprintf(prompt, sizeof(prompt), "Challenge #%d:", i + 1); + n = snprintf(prompt, sizeof(prompt), "Challenge #%u:", i + 1); if (n <= 0 || (size_t) n >= sizeof(prompt)) { debug_dbg(cfg, "Failed to print challenge prompt"); goto out; @@ -1449,7 +1449,7 @@ int do_manual_authentication(const cfg_t *cfg, const device_t *devices, "paste the results in the prompt below."); for (i = 0; i < n_devs; ++i) { - n = snprintf(prompt, sizeof(prompt), "Response #%d: ", i + 1); + n = snprintf(prompt, sizeof(prompt), "Response #%u: ", i + 1); if (n <= 0 || (size_t) n >= sizeof(prompt)) { debug_dbg(cfg, "Failed to print response prompt"); goto out;