From 4491ef0a9a15d3b307d1ade37ff620ef9fcb2478 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 13 Sep 2016 20:46:41 +0200 Subject: tests: Use gpgme_io_write in passhrase callbacks. * tests/gpg/t-support.h (passphrase_cb): Use gpgme_io_write. * tests/gpgsm/t-support.h (passphrase_cb): Ditto. * tests/run-support.h (passphrase_cb): Ditto. Signed-off-by: Werner Koch --- tests/gpgsm/t-support.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/gpgsm/t-support.h') diff --git a/tests/gpgsm/t-support.h b/tests/gpgsm/t-support.h index cc1a7db9..ae3ad1f6 100644 --- a/tests/gpgsm/t-support.h +++ b/tests/gpgsm/t-support.h @@ -63,13 +63,18 @@ passphrase_cb (void *opaque, const char *uid_hint, const char *passphrase_info, int last_was_bad, int fd) { int res; - char *pass = "abc\n"; + char pass[] = "abc\n"; int passlen = strlen (pass); int off = 0; + (void)opaque; + (void)uid_hint; + (void)passphrase_info; + (void)last_was_bad; + do { - res = write (fd, &pass[off], passlen - off); + res = gpgme_io_write (fd, &pass[off], passlen - off); if (res > 0) off += res; } -- cgit v1.2.3