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:
committed by
Andreas Schneider
parent
46475dfa2f
commit
166ee451c5
@@ -140,7 +140,7 @@ char *ssh_get_local_username(ssh_session session) {
|
|||||||
/* get the size */
|
/* get the size */
|
||||||
GetUserName(NULL, &size);
|
GetUserName(NULL, &size);
|
||||||
|
|
||||||
user = malloc(size);
|
user = (char *) malloc(size);
|
||||||
if (user == NULL) {
|
if (user == NULL) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -159,7 +159,7 @@ int ssh_is_ipaddr_v4(const char *str) {
|
|||||||
int rc = SOCKET_ERROR;
|
int rc = SOCKET_ERROR;
|
||||||
|
|
||||||
/* WSAStringToAddressA thinks that 0.0.0 is a valid IP */
|
/* WSAStringToAddressA thinks that 0.0.0 is a valid IP */
|
||||||
if (strlen < 7) {
|
if (strlen(str) < 7) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -125,7 +125,7 @@ struct ssh_pcap_file_struct {
|
|||||||
ssh_pcap_file ssh_pcap_file_new(){
|
ssh_pcap_file ssh_pcap_file_new(){
|
||||||
struct ssh_pcap_file_struct *pcap;
|
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) {
|
if (pcap == NULL) {
|
||||||
return 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 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){
|
if(ctx==NULL){
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -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) {
|
if (server->methods == NULL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -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 */
|
/* Check if we are in a connecting state */
|
||||||
if(s->state==SSH_SOCKET_CONNECTING){
|
if(s->state==SSH_SOCKET_CONNECTING){
|
||||||
s->state=SSH_SOCKET_ERROR;
|
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;
|
s->last_errno=err;
|
||||||
ssh_socket_close(s);
|
ssh_socket_close(s);
|
||||||
if(s->callbacks && s->callbacks->connected)
|
if(s->callbacks && s->callbacks->connected)
|
||||||
|
Reference in New Issue
Block a user