rsaz-x86_64.pl: add MULX/ADCX/ADOX code path.
[openssl.git] / crypto / bio / bss_conn.c
index 33702eb99b1a635e4190965c46bc86b372c5947c..c14727855b259b30b1ed679948337ba2f2e95a1f 100644 (file)
@@ -130,7 +130,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
        int ret= -1,i;
        unsigned long l;
        char *p,*q;
-       int (*cb)()=NULL;
+       int (*cb)(const BIO *,int,int)=NULL;
 
        if (c->info_callback != NULL)
                cb=c->info_callback;
@@ -469,7 +469,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                break;
        case BIO_C_DO_STATE_MACHINE:
                /* use this one to start the connection */
-               if (!data->state != BIO_CONN_S_OK)
+               if (data->state != BIO_CONN_S_OK)
                        ret=(long)conn_state(b,data);
                else
                        ret=1;
@@ -521,8 +521,8 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                                char buf[16];
                                unsigned char *p = ptr;
 
-                               sprintf(buf,"%d.%d.%d.%d",
-                                       p[0],p[1],p[2],p[3]);
+                               BIO_snprintf(buf,sizeof buf,"%d.%d.%d.%d",
+                                            p[0],p[1],p[2],p[3]);
                                if (data->param_hostname != NULL)
                                        OPENSSL_free(data->param_hostname);
                                data->param_hostname=BUF_strdup(buf);
@@ -532,7 +532,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                                {
                                char buf[DECIMAL_SIZE(int)+1];
 
-                               sprintf(buf,"%d",*(int *)ptr);
+                               BIO_snprintf(buf,sizeof buf,"%d",*(int *)ptr);
                                if (data->param_port != NULL)
                                        OPENSSL_free(data->param_port);
                                data->param_port=BUF_strdup(buf);
@@ -590,9 +590,9 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
                break;
        case BIO_CTRL_GET_CALLBACK:
                {
-               int (**fptr)();
+               int (**fptr)(const BIO *bio,int state,int xret);
 
-               fptr=(int (**)())ptr;
+               fptr=(int (**)(const BIO *bio,int state,int xret))ptr;
                *fptr=data->info_callback;
                }
                break;