2002-09-02 Marcus Brinkmann <marcus@g10code.de>
* conversion.c (_gpgme_decode_c_string): Fix off by one error in last change. * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before _gpgme_op_edit so its prototype is known early on.
This commit is contained in:
parent
7bc8297fe7
commit
d55e88d0bc
@ -1,5 +1,9 @@
|
||||
2002-09-02 Marcus Brinkmann <marcus@g10code.de>
|
||||
|
||||
* conversion.c (_gpgme_decode_c_string): Fix off by one error in last change.
|
||||
* rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
|
||||
_gpgme_op_edit so its prototype is known early on.
|
||||
|
||||
* conversion.c: New file.
|
||||
* util.h: Add prototypes for _gpgme_decode_c_string and
|
||||
_gpgme_hextobyte.
|
||||
|
@ -58,7 +58,7 @@ _gpgme_decode_c_string (const char *src, char **destp)
|
||||
|
||||
/* We can malloc a buffer of the same length, because the converted
|
||||
string will never be larger. */
|
||||
dest = xtrymalloc (strlen (src));
|
||||
dest = xtrymalloc (strlen (src) + 1);
|
||||
if (!dest)
|
||||
return mk_error (Out_Of_Core);
|
||||
|
||||
|
@ -1439,6 +1439,32 @@ _gpgme_gpg_op_delete (GpgObject gpg, GpgmeKey key, int allow_secret)
|
||||
}
|
||||
|
||||
|
||||
static GpgmeError
|
||||
_gpgme_append_gpg_args_from_signers (GpgObject gpg,
|
||||
GpgmeCtx ctx /* FIXME */)
|
||||
{
|
||||
GpgmeError err = 0;
|
||||
int i;
|
||||
GpgmeKey key;
|
||||
|
||||
for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++)
|
||||
{
|
||||
const char *s = gpgme_key_get_string_attr (key, GPGME_ATTR_KEYID,
|
||||
NULL, 0);
|
||||
if (s)
|
||||
{
|
||||
if (!err)
|
||||
err = _gpgme_gpg_add_arg (gpg, "-u");
|
||||
if (!err)
|
||||
err = _gpgme_gpg_add_arg (gpg, s);
|
||||
}
|
||||
gpgme_key_unref (key);
|
||||
if (err) break;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
GpgmeError
|
||||
_gpgme_gpg_op_edit (GpgObject gpg, GpgmeKey key, GpgmeData out,
|
||||
GpgmeCtx ctx /* FIXME */)
|
||||
@ -1487,32 +1513,6 @@ _gpgme_append_gpg_args_from_recipients (GpgObject gpg,
|
||||
}
|
||||
|
||||
|
||||
static GpgmeError
|
||||
_gpgme_append_gpg_args_from_signers (GpgObject gpg,
|
||||
GpgmeCtx ctx /* FIXME */)
|
||||
{
|
||||
GpgmeError err = 0;
|
||||
int i;
|
||||
GpgmeKey key;
|
||||
|
||||
for (i = 0; (key = gpgme_signers_enum (ctx, i)); i++)
|
||||
{
|
||||
const char *s = gpgme_key_get_string_attr (key, GPGME_ATTR_KEYID,
|
||||
NULL, 0);
|
||||
if (s)
|
||||
{
|
||||
if (!err)
|
||||
err = _gpgme_gpg_add_arg (gpg, "-u");
|
||||
if (!err)
|
||||
err = _gpgme_gpg_add_arg (gpg, s);
|
||||
}
|
||||
gpgme_key_unref (key);
|
||||
if (err) break;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
GpgmeError
|
||||
_gpgme_gpg_op_encrypt (GpgObject gpg, GpgmeRecipients recp,
|
||||
GpgmeData plain, GpgmeData ciph, int use_armor)
|
||||
|
Loading…
Reference in New Issue
Block a user