diff options
author | Werner Koch <[email protected]> | 2013-02-22 09:56:13 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2013-02-22 09:56:13 +0000 |
commit | 585d5c62eece23911a768d97d11f159be138b13d (patch) | |
tree | 32ac4792efcdd419d1f725b13671a540770943d6 /agent/call-pinentry.c | |
parent | Remove some unused variables. (diff) | |
download | gnupg-585d5c62eece23911a768d97d11f159be138b13d.tar.gz gnupg-585d5c62eece23911a768d97d11f159be138b13d.zip |
Use has_leading_keyword in the assuan callbacks.
* agent/call-pinentry.c (inq_quality): Use has_leading_keyword.
* agent/call-scd.c (inq_needpin, inq_writekey_parms): Ditto.
* g10/call-agent.c (inq_writecert_parms, keyinfo_status_cb): Ditto.
(inq_genkey_parms, inq_ciphertext_cb, inq_import_key_parms): Ditto.
* g10/call-dirmngr.c (ks_put_inq_cb): Ditto.
* sm/call-agent.c (default_inq_cb, inq_ciphertext_cb): Ditto.
(inq_genkey_parms, istrusted_status_cb, learn_status_cb): Ditto.
(keyinfo_status_cb, inq_import_key_parms): Ditto.
* sm/call-dirmngr.c (inq_certificate, isvalid_status_cb): Ditto.
(lookup_status_cb, run_command_inq_cb, run_command_status_cb): Ditto.
Diffstat (limited to '')
-rw-r--r-- | agent/call-pinentry.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index c6b6b5282..78e1c1106 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -596,18 +596,15 @@ static gpg_error_t inq_quality (void *opaque, const char *line) { assuan_context_t ctx = opaque; + const char *s; char *pin; int rc; int percent; char numbuf[20]; - if (!strncmp (line, "QUALITY", 7) && (line[7] == ' ' || !line[7])) + if ((s = has_leading_keyword (line, "QUALITY"))) { - line += 7; - while (*line == ' ') - line++; - - pin = unescape_passphrase_string (line); + pin = unescape_passphrase_string (s); if (!pin) rc = gpg_error_from_syserror (); else |