From: Shantonu Sen Date: Tue, 9 May 2000 06:09:05 +0000 (+0000) Subject: Fix some compile-time warnings. X-Git-Tag: kim-before-sasl~47 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=966e60efa721d87e5f1cd475de08c26e3bac967e;p=mmh Fix some compile-time warnings. --- diff --git a/sbr/getpass.c b/sbr/getpass.c index 6a53b72..cca32f6 100644 --- a/sbr/getpass.c +++ b/sbr/getpass.c @@ -30,11 +30,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $ID$ + * $Id$ */ #include -#include #include #define PASSWORD_LEN 128 @@ -43,18 +42,22 @@ #define TCSANOW 0 #endif -char *getpass(const char *prompt) +char * +getpass(char *prompt) { struct termios oterm, term; - int ch; - char *p, *ttystring, buf[PASSWORD_LEN+1]; + char ch; + char *p, *ttystring, *buf; FILE *fout, *fin; + if(!(buf = (char *)calloc((size_t)(PASSWORD_LEN+1), sizeof(char)))) + adios(NULL, "unable to allocate string storage"); + /* Find if stdin is connect to a terminal. If so, read directly from * the terminal, and turn off echo. Otherwise read from stdin. */ - if((ttystring = ttyname(fileno(stdin))) == NULL) { + if((ttystring = (char *)ttyname(fileno(stdin))) == NULL) { fout = stderr; fin = stdin; } @@ -80,5 +83,5 @@ char *getpass(const char *prompt) (void)fputc('\n', fout); (void)fclose(fin); } - return(buf); + return((char *)buf); } diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index 68809df..085d493 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -162,7 +162,7 @@ done: char *mypass; snprintf(prompt, sizeof(prompt), "Password (%s:%s): ", host, *aname); - mypass = getpass (prompt); + mypass = (char *)getpass (prompt); if (*mypass == '\0') { mypass = *aname;