core: Do not pass const char* to functions taking a char*.
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
0510591c36
commit
3972f476e0
@ -895,6 +895,7 @@ arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts)
|
||||
char **argv;
|
||||
char *s, *s2;
|
||||
int i;
|
||||
char string_with_x[] = "x";
|
||||
|
||||
initialize( arg, NULL, NULL );
|
||||
argc = *arg->argc;
|
||||
@ -1106,7 +1107,7 @@ arg_parse( ARGPARSE_ARGS *arg, ARGPARSE_OPTS *opts)
|
||||
argc--; argv++; idx++; /* Skip one. */
|
||||
}
|
||||
}
|
||||
s = "x"; /* This is so that !s[1] yields false. */
|
||||
s = string_with_x; /* This is so that !s[1] yields false. */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1081,7 +1081,11 @@ read_status (engine_gpg_t gpg)
|
||||
err = gpg->status.mon_cb (gpg->status.mon_cb_value,
|
||||
GPGME_STATUS_EOF, "");
|
||||
if (gpg->status.fnc)
|
||||
err = gpg->status.fnc (gpg->status.fnc_value, GPGME_STATUS_EOF, "");
|
||||
{
|
||||
char emptystring[1] = {0};
|
||||
err = gpg->status.fnc (gpg->status.fnc_value,
|
||||
GPGME_STATUS_EOF, emptystring);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -818,8 +818,11 @@ status_handler (void *opaque, int fd)
|
||||
&& (line[2] == '\0' || line[2] == ' '))
|
||||
{
|
||||
if (gpgsm->status.fnc)
|
||||
{
|
||||
char emptystring[1] = {0};
|
||||
err = gpgsm->status.fnc (gpgsm->status.fnc_value,
|
||||
GPGME_STATUS_EOF, "");
|
||||
GPGME_STATUS_EOF, emptystring);
|
||||
}
|
||||
|
||||
if (!err && gpgsm->colon.fnc && gpgsm->colon.any)
|
||||
{
|
||||
|
@ -669,8 +669,11 @@ status_handler (void *opaque, int fd)
|
||||
&& (line[2] == '\0' || line[2] == ' '))
|
||||
{
|
||||
if (uiserver->status.fnc)
|
||||
{
|
||||
char emptystring[1] = {0};
|
||||
err = uiserver->status.fnc (uiserver->status.fnc_value,
|
||||
GPGME_STATUS_EOF, "");
|
||||
GPGME_STATUS_EOF, emptystring);
|
||||
}
|
||||
|
||||
if (!err && uiserver->colon.fnc && uiserver->colon.any)
|
||||
{
|
||||
|
@ -337,13 +337,14 @@ result_xml_indent (struct result_xml_state *state)
|
||||
|
||||
|
||||
gpg_error_t
|
||||
result_xml_tag_start (struct result_xml_state *state, char *name, ...)
|
||||
result_xml_tag_start (struct result_xml_state *state, const char *name, ...)
|
||||
{
|
||||
result_xml_write_cb_t cb = state->cb;
|
||||
void *hook = state->hook;
|
||||
va_list ap;
|
||||
char *attr;
|
||||
char *attr_val;
|
||||
char string_null[] = "(null)";
|
||||
|
||||
va_start (ap, name);
|
||||
|
||||
@ -374,7 +375,7 @@ result_xml_tag_start (struct result_xml_state *state, char *name, ...)
|
||||
|
||||
attr_val = va_arg (ap, char *);
|
||||
if (attr_val == NULL)
|
||||
attr_val = "(null)";
|
||||
attr_val = string_null;
|
||||
|
||||
(*cb) (hook, " ", 1);
|
||||
(*cb) (hook, attr, strlen (attr));
|
||||
|
Loading…
Reference in New Issue
Block a user