Ignore:
Timestamp:
Jul 29, 2006 8:29:24 PM (17 years ago)
Author:
bennylp
Message:

Another take at fixing 64bit problems. PJ_MAX_OBJ_NAME is increased to 32 chars (from 16), and check all those sprintf's especially the ones with "%p" format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r610 r635  
    168168                                   const pj_sockaddr_in *addr ) 
    169169{ 
    170     host_port->host.ptr = pj_pool_alloc(pool, 48); 
    171     host_port->host.slen = pj_ansi_sprintf( host_port->host.ptr, "%s",  
     170    enum { M = 48 }; 
     171    host_port->host.ptr = pj_pool_alloc(pool, M); 
     172    host_port->host.slen = pj_ansi_snprintf( host_port->host.ptr, M, "%s",  
    172173                                            pj_inet_ntoa(addr->sin_addr)); 
    173174    host_port->port = pj_ntohs(addr->sin_port); 
     
    260261    } 
    261262 
    262     pj_ansi_sprintf(listener->obj_name, "tcp:%d",  
    263                      (int)pj_ntohs(listener_addr->sin_port)); 
     263    pj_ansi_snprintf(listener->obj_name, sizeof(listener->obj_name),  
     264                     "tcp:%d",  (int)pj_ntohs(listener_addr->sin_port)); 
    264265 
    265266    /* Save the address name */ 
Note: See TracChangeset for help on using the changeset viewer.