Removed unnecessary casts and added const where necessary.

This commit is contained in:
Dan Fandrich
2007-08-09 01:10:11 +00:00
parent 17173aab0e
commit c4630d1ffb
14 changed files with 66 additions and 66 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: ssh2.c,v 1.16 2007/08/03 15:08:28 jehousley Exp $
* $Id: ssh2.c,v 1.17 2007/08/09 01:10:11 dfandrich Exp $
*
* Sample showing how to do SSH2 connect.
*
@@ -36,10 +36,10 @@
#include <ctype.h>
char *keyfile1=(char *)"~/.ssh/id_rsa.pub";
char *keyfile2=(char *)"~/.ssh/id_rsa";
char *username=(char *)"username";
char *password=(char *)"password";
const char *keyfile1="~/.ssh/id_rsa.pub";
const char *keyfile2="~/.ssh/id_rsa";
const char *username="username";
const char *password="password";
static void kbd_callback(const char *name, int name_len,
@@ -189,12 +189,12 @@ int main(int argc, char *argv[])
/* Some environment variables may be set,
* It's up to the server which ones it'll allow though
*/
libssh2_channel_setenv(channel, (char *)"FOO", (char *)"bar");
libssh2_channel_setenv(channel, "FOO", "bar");
/* Request a terminal with 'vanilla' terminal emulation
* See /etc/termcap for more options
*/
if (libssh2_channel_request_pty(channel, (char *)"vanilla")) {
if (libssh2_channel_request_pty(channel, "vanilla")) {
fprintf(stderr, "Failed requesting pty\n");
goto skip_shell;
}