aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Stöneberg <oliverst@online.de>2011-04-11 11:17:32 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-04-11 11:19:26 +0200
commitaf25fc35d14285c1422ba0a025de1a16ea9e3486 (patch)
treea17d1b56634b937a81035f04aa90163e41883678
parentdb49b84a44b07bd5560dc03758452740eae79932 (diff)
downloadlibssh-af25fc35d14285c1422ba0a025de1a16ea9e3486.tar.gz
libssh-af25fc35d14285c1422ba0a025de1a16ea9e3486.tar.xz
libssh-af25fc35d14285c1422ba0a025de1a16ea9e3486.zip
build: Fixed some VS2010 problems.
(cherry picked from commit 166ee451c500543db49e789b9bb2ed16db052f94)
-rw-r--r--src/misc.c4
-rw-r--r--src/pcap.c4
-rw-r--r--src/server.c2
-rw-r--r--src/socket.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/misc.c b/src/misc.c
index 3b4b5059..84858ea6 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -140,7 +140,7 @@ char *ssh_get_local_username(ssh_session session) {
/* get the size */
GetUserName(NULL, &size);
- user = malloc(size);
+ user = (char *) malloc(size);
if (user == NULL) {
ssh_set_error_oom(session);
return NULL;
@@ -159,7 +159,7 @@ int ssh_is_ipaddr_v4(const char *str) {
int rc = SOCKET_ERROR;
/* WSAStringToAddressA thinks that 0.0.0 is a valid IP */
- if (strlen < 7) {
+ if (strlen(str) < 7) {
return 0;
}
diff --git a/src/pcap.c b/src/pcap.c
index 95db72d7..f81c955d 100644
--- a/src/pcap.c
+++ b/src/pcap.c
@@ -125,7 +125,7 @@ struct ssh_pcap_file_struct {
ssh_pcap_file ssh_pcap_file_new(){
struct ssh_pcap_file_struct *pcap;
- pcap = malloc(sizeof(struct ssh_pcap_file_struct));
+ pcap = (struct ssh_pcap_file_struct *) malloc(sizeof(struct ssh_pcap_file_struct));
if (pcap == NULL) {
return NULL;
}
@@ -228,7 +228,7 @@ void ssh_pcap_file_free(ssh_pcap_file pcap){
*/
ssh_pcap_context ssh_pcap_context_new(ssh_session session){
- ssh_pcap_context ctx=malloc(sizeof(struct ssh_pcap_context_struct));
+ ssh_pcap_context ctx = (struct ssh_pcap_context_struct *) malloc(sizeof(struct ssh_pcap_context_struct));
if(ctx==NULL){
ssh_set_error_oom(session);
return NULL;
diff --git a/src/server.c b/src/server.c
index cb29d240..c86c2f4a 100644
--- a/src/server.c
+++ b/src/server.c
@@ -104,7 +104,7 @@ static int server_set_kex(ssh_session session) {
}
}
- server->methods = malloc(10 * sizeof(char **));
+ server->methods = (char **) malloc(10 * sizeof(char **));
if (server->methods == NULL) {
return -1;
}
diff --git a/src/socket.c b/src/socket.c
index 24616255..fa7ed526 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -218,7 +218,7 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd, int r
/* Check if we are in a connecting state */
if(s->state==SSH_SOCKET_CONNECTING){
s->state=SSH_SOCKET_ERROR;
- getsockopt(fd,SOL_SOCKET,SO_ERROR,(void *)&err,&errlen);
+ getsockopt(fd,SOL_SOCKET,SO_ERROR,(char *)&err,&errlen);
s->last_errno=err;
ssh_socket_close(s);
if(s->callbacks && s->callbacks->connected)