Commit c54b09a7 authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Fix a few compilations errors and warnings

parent 66ff004e
......@@ -647,7 +647,7 @@ static int sip_rad_req( struct rgwp_config * cs, struct session ** session, stru
#define SIP_PREFIX "sip:"
size_t temp_len = attr->length - sizeof(struct radius_attr_hdr) + CONSTSTRLEN(SIP_PREFIX) + 1;
CHECK_MALLOC( temp = malloc(temp_len) );
temp_len = snprintf((char *)temp, temp_len, SIP_PREFIX "%.*s", attr->length - sizeof(struct radius_attr_hdr), (char *)(attr + 1));
temp_len = snprintf((char *)temp, temp_len, SIP_PREFIX "%.*s", (int)(attr->length - sizeof(struct radius_attr_hdr)), (char *)(attr + 1));
value.os.data=temp;
value.os.len=temp_len;
......
......@@ -155,7 +155,8 @@ struct cnxctx * fd_cnx_serv_sctp(uint16_t port, struct fd_list * ep_list)
#ifdef DISABLE_SCTP
TRACE_DEBUG(INFO, "This function should never been called when SCTP is disabled...");
ASSERT(0);
CHECK_FCT_DO( ENOTSUP, return NULL);
CHECK_FCT_DO( ENOTSUP, );
return NULL;
#else /* DISABLE_SCTP */
struct cnxctx * cnx = NULL;
......@@ -354,7 +355,8 @@ struct cnxctx * fd_cnx_cli_connect_sctp(int no_ip6, uint16_t port, struct fd_lis
#ifdef DISABLE_SCTP
TRACE_DEBUG(INFO, "This function should never be called when SCTP is disabled...");
ASSERT(0);
CHECK_FCT_DO( ENOTSUP, return NULL);
CHECK_FCT_DO( ENOTSUP, );
return NULL;
#else /* DISABLE_SCTP */
int sock = 0;
struct cnxctx * cnx = NULL;
......@@ -498,7 +500,7 @@ int fd_cnx_getTLS(struct cnxctx * conn)
int fd_cnx_isMultichan(struct cnxctx * conn)
{
CHECK_PARAMS_DO( conn, return 0 );
#ifdef DISABLE_SCTP
#ifndef DISABLE_SCTP
if (conn->cc_proto == IPPROTO_SCTP)
return (conn->cc_sctp_para.str_in > 1) || (conn->cc_sctp_para.str_out > 1);
#endif /* DISABLE_SCTP */
......
......@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
#ifdef DIAMID_IDNA_IGNORE
/* The UTF-8 chars are considered valid */
CHECK( 1, fd_os_is_valid_DiameterIdentity((os0_t)TEST_IDN_UTF8, CONSTSTRLEN(TEST_IDN_UTF8) );
CHECK( 1, fd_os_is_valid_DiameterIdentity((os0_t)TEST_IDN_UTF8, CONSTSTRLEN(TEST_IDN_UTF8) ) );
/* The string should be passed unmodified */
CHECK( 0, fd_os_validate_DiameterIdentity(&res, &len, 1) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment