# HG changeset patch # User Gaƫl PORTAY # Date 1430577059 -7200 # Node ID 5806c644469abd5a543e658b37af6c0b6eb39f4d # Parent 303e27a78d2e4d7bc4ae4116d5b401f8880873e6 Turn get_response()'s return type and prompt argument into char * diff -r 303e27a78d2e -r 5806c644469a cli-authinteract.c --- a/cli-authinteract.c Sun May 03 01:12:24 2015 +0200 +++ b/cli-authinteract.c Sat May 02 16:30:59 2015 +0200 @@ -31,10 +31,10 @@ #ifdef ENABLE_CLI_INTERACT_AUTH -static unsigned char* get_response(unsigned char* prompt) +static char* get_response(char* prompt) { FILE* tty = NULL; - unsigned char* response = NULL; + char* response = NULL; /* not a password, but a reasonable limit */ char buf[DROPBEAR_MAX_CLI_PASS]; char* ret = NULL; @@ -50,13 +50,13 @@ } if (ret == NULL) { - response = (unsigned char*)m_strdup(""); + response = m_strdup(""); } else { unsigned int buflen = strlen(buf); /* fgets includes newlines */ if (buflen > 0 && buf[buflen-1] == '\n') buf[buflen-1] = '\0'; - response = (unsigned char*)m_strdup(buf); + response = m_strdup(buf); } m_burn(buf, sizeof(buf)); @@ -71,9 +71,9 @@ unsigned int num_prompts = 0; unsigned int i; - unsigned char *prompt = NULL; + char *prompt = NULL; unsigned int echo = 0; - unsigned char *response = NULL; + char *response = NULL; TRACE(("enter recv_msg_recv_userauth_info_request")) @@ -115,13 +115,13 @@ for (i = 0; i < num_prompts; i++) { unsigned int response_len = 0; - prompt = buf_getstring(ses.payload, NULL); + prompt = (char *)buf_getstring(ses.payload, NULL); cleantext(prompt); echo = buf_getbool(ses.payload); if (!echo) { - unsigned char* p = getpass_or_cancel(prompt); + char* p = getpass_or_cancel(prompt); response = m_strdup(p); m_burn(p, strlen(p)); } else { @@ -129,7 +129,7 @@ } response_len = strlen(response); - buf_putstring(ses.writepayload, response, response_len); + buf_putstring(ses.writepayload, (const unsigned char *)response, response_len); m_burn(response, response_len); m_free(prompt); m_free(response);