Changeset 846 for releases

Show
Ignore:
Timestamp:
04/24/06 19:48:39 (3 years ago)
Author:
aj
Message:

fix invalid use of ct_socket_connect, reported by ludovic rousseau.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • releases/openct-0.6.7/src/ifd/ria.c

    r682 r846  
    3535{ 
    3636        ria_client_t *clnt; 
     37        int reader; 
    3738        int rc; 
     39 
     40        if (scanf("5d",address,&reader) != 1) { 
     41                ct_error("can't parse address \"%s\"",address); 
     42                return NULL; 
     43        } 
    3844 
    3945        clnt = (ria_client_t *) calloc(1, sizeof(*clnt) + RIA_QUEUE_LEN); 
     
    4551 
    4652        clnt->sock = ct_socket_new(1024); 
    47         if ((rc = ct_socket_connect(clnt->sock, address)) < 0) { 
    48                 ct_error("Failed to connect to RIA server \"%s\": %s", 
    49                          address, ct_strerror(rc)); 
     53        if ((rc = ct_socket_connect(clnt->sock, reader)) < 0) { 
     54                ct_error("Failed to connect to RIA server %d: %s", 
     55                         reader, ct_strerror(rc)); 
    5056                ria_free(clnt); 
    5157                return NULL;