1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

build: Fixed some VS2010 problems.

This commit is contained in:
Oliver Stöneberg
2011-04-11 11:17:32 +02:00
committed by Andreas Schneider
parent 46475dfa2f
commit 166ee451c5
4 changed files with 6 additions and 6 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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)