[Pkg-gnupg-commit] [gpgme] 347/412: core: Cast away the common const problem with spawn and argv.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Sep 22 21:27:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gpgme.
commit 686a065f639ef006e33c164e282d787bcd169754
Author: Werner Koch <wk at gnupg.org>
Date: Tue Sep 13 20:57:15 2016 +0200
core: Cast away the common const problem with spawn and argv.
* src/dirinfo.c (read_gpgconf_dirs): Use a cast to assignd to ARGV.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
src/dirinfo.c | 2 +-
src/engine-gpgconf.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/dirinfo.c b/src/dirinfo.c
index ecb1c0c..b24a8a0 100644
--- a/src/dirinfo.c
+++ b/src/dirinfo.c
@@ -193,7 +193,7 @@ read_gpgconf_dirs (const char *pgmname, int components)
char *mark = NULL;
argv[0] = (char *)pgmname;
- argv[1] = components? "--list-components" : "--list-dirs";
+ argv[1] = (char*)(components? "--list-components" : "--list-dirs");
argv[2] = NULL;
if (_gpgme_io_pipe (rp, 1) < 0)
diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c
index d5e7e2b..015ef00 100644
--- a/src/engine-gpgconf.c
+++ b/src/engine-gpgconf.c
@@ -200,7 +200,7 @@ gpgconf_config_release (gpgme_conf_comp_t conf)
allow for quite a long "group" line, which is usually the longest
line (mine is currently ~3k). */
static gpgme_error_t
-gpgconf_read (void *engine, char *arg1, char *arg2,
+gpgconf_read (void *engine, const char *arg1, char *arg2,
gpgme_error_t (*cb) (void *hook, char *line),
void *hook)
{
@@ -217,7 +217,7 @@ gpgconf_read (void *engine, char *arg1, char *arg2,
int nread;
char *mark = NULL;
- argv[1] = arg1;
+ argv[1] = (char*)arg1;
argv[2] = arg2;
@@ -678,14 +678,14 @@ _gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, gpgme_conf_arg_t arg)
/* FIXME: Major problem: We don't get errors from gpgconf. */
static gpgme_error_t
-gpgconf_write (void *engine, char *arg1, char *arg2, gpgme_data_t conf)
+gpgconf_write (void *engine, const char *arg1, char *arg2, gpgme_data_t conf)
{
struct engine_gpgconf *gpgconf = engine;
gpgme_error_t err = 0;
#define BUFLEN 1024
char buf[BUFLEN];
int buflen = 0;
- char *argv[] = { NULL /* file_name */, arg1, arg2, 0 };
+ char *argv[] = { NULL /* file_name */, (char*)arg1, arg2, 0 };
int rp[2];
struct spawn_fd_item_s cfd[] = { {-1, 0 /* STDIN_FILENO */}, {-1, -1} };
int status;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git
More information about the Pkg-gnupg-commit
mailing list