aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 70e8359b..c56da532 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)