rem: via_len+=msg->add_to_branch_len;
add: via_len+=msg->add_to_branch_len-1; }
context: char* via_builder( struct sip_msg *msg , unsigned int *len ){	unsigned int  via_len, branch_len;	char               *line_buf;	line_buf=0;	line_buf=pkg_malloc(sizeof(char)*MAX_VIA_LINE_SIZE);	if (line_buf==0){		LOG(L_ERR, "ERROR: via_builder: out of memory\n");		goto error;	}	via_len=MY_VIA_LEN+names_len[0]; /* space included in MY_VIA*/	/* jku: if we compute branches using MD5 it will take 32 bytes */	branch_len= (loop_checks ? MY_BRANCH_LEN : MY_BRANCH_LEN -1 + MD5_LEN)+					msg->add_to_branch_len;	if ((via_len+port_no_str_len+branch_len+CRLF_LEN)<MAX_VIA_LINE_SIZE){		memcpy(line_buf, MY_VIA, MY_VIA_LEN);		memcpy(line_buf+MY_VIA_LEN, names[0], names_len[0]);		if (port_no!=SIP_PORT){			memcpy(line_buf+via_len, port_no_str, port_no_str_len);			via_len+=port_no_str_len;		}		/* jku: branch parameter */		memcpy(line_buf+via_len, MY_BRANCH, MY_BRANCH_LEN );		via_len+=MY_BRANCH_LEN;		/* loop checks ?		if (loop_checks) {			if (check_transaction_quadruple( msg )) {				str src[5];				int r;				src[0]= msg->from->body;				src[1]= msg->to->body;				src[2]= msg->callid->body;				src[3]= msg->first_line.u.request.uri;				src[4]= get_cseq( msg )->number;				MDStringArray ( line_buf+via_len-1, src, 5 );				via_len+=MD5_LEN - 1;			} else DBG("DEBUG: via_builder: required HFs for "					"loop checking missing\n");		}  */		//DBG("DEBUG: XXX will add branch now: %s (%d)\n", msg->add_to_branch_s, msg->add_to_branch_len );		/* someone wants me to add something to branch here ? */		memcpy(line_buf+via_len-1, msg->add_to_branch_s,				msg->add_to_branch_len );		via_len+=msg->add_to_branch_len;		memcpy(line_buf+via_len, CRLF, CRLF_LEN);		via_len+=CRLF_LEN;		line_buf[via_len]=0; /* null terminate the string*/	}else{		LOG(L_ERR, " ERROR: via_builder: via too long (%d)\n",				via_len);		goto error;	}	*len = via_len;	return line_buf;error:	if (line_buf) pkg_free(line_buf);	return 0;}