mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Make prototype for new_prompts() consistent.
In commitb4c8fd9d8
which introduced the Seat trait, I got a bit confused about the prototype of new_prompts(). Previously it took a 'Frontend *' parameter; I edited the call sites to pass a 'Seat *' instead, but the actual function definition takes no parameters at all - and rightly so, because the 'Frontend *' inside the prompts_t has been removed and _not_ replaced with a 'Seat *', so the constructor would have nothing to do with such a thing anyway. But I wrote the function declaration in putty.h with '()' rather than '(void)' (too much time spent in C++), and so the compiler never spotted the mismatch. Now new_prompts() is consistently nullary everywhere it appears: the prototype in the header is a proper (void) one, and the call sites have been modified to not pointlessly give it a Seat or null pointer. (cherry picked from commitd183484742
)
This commit is contained in:
parent
e564a5f05d
commit
964058b5ef
2
cmdgen.c
2
cmdgen.c
@ -903,7 +903,7 @@ int main(int argc, char **argv)
|
||||
* we have just generated a key.
|
||||
*/
|
||||
if (!new_passphrase && (change_passphrase || keytype != NOKEYGEN)) {
|
||||
prompts_t *p = new_prompts(NULL);
|
||||
prompts_t *p = new_prompts();
|
||||
int ret;
|
||||
|
||||
p->to_server = false;
|
||||
|
2
putty.h
2
putty.h
@ -667,7 +667,7 @@ typedef struct {
|
||||
void *data; /* slot for housekeeping data, managed by
|
||||
* seat_get_userpass_input(); initially NULL */
|
||||
} prompts_t;
|
||||
prompts_t *new_prompts();
|
||||
prompts_t *new_prompts(void);
|
||||
void add_prompt(prompts_t *p, char *promptstr, bool echo);
|
||||
void prompt_set_result(prompt_t *pr, const char *newstr);
|
||||
char *prompt_get_result(prompt_t *pr);
|
||||
|
@ -648,7 +648,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
|
||||
ppl_printf("No passphrase required.\r\n");
|
||||
passphrase = NULL;
|
||||
} else {
|
||||
s->cur_prompt = new_prompts(s->ppl.seat);
|
||||
s->cur_prompt = new_prompts();
|
||||
s->cur_prompt->to_server = false;
|
||||
s->cur_prompt->from_server = false;
|
||||
s->cur_prompt->name = dupstr("SSH key passphrase");
|
||||
@ -787,7 +787,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
|
||||
/*
|
||||
* Otherwise, try various forms of password-like authentication.
|
||||
*/
|
||||
s->cur_prompt = new_prompts(s->ppl.seat);
|
||||
s->cur_prompt = new_prompts();
|
||||
|
||||
if (conf_get_bool(s->conf, CONF_try_tis_auth) &&
|
||||
(s->supported_auths_mask & (1 << SSH1_AUTH_TIS)) &&
|
||||
|
Loading…
Reference in New Issue
Block a user