Browse code

fix: 0 character reversed to backup correctly

Jiri Kuthan authored on 13/04/2003 23:15:43
Showing 1 changed files
... ...
@@ -1514,6 +1514,7 @@ char * build_res_buf_with_body_from_sip_req( unsigned int code, char *text ,
1514 1514
 	char *after_body;
1515 1515
 	str  to_tag;
1516 1516
 	char *totags;
1517
+	int rcvd;
1517 1518
 
1518 1519
 	received_buf=0;
1519 1520
 	received_len=0;
... ...
@@ -1540,10 +1541,11 @@ char * build_res_buf_with_body_from_sip_req( unsigned int code, char *text ,
1540 1540
 	/* check if received needs to be added */
1541 1541
 	backup = msg->via1->host.s[msg->via1->host.len];
1542 1542
 	msg->via1->host.s[msg->via1->host.len] = 0;
1543
-	if (msg->via1->received || 
1544
-			check_via_address(&msg->rcv.src_ip, &msg->via1->host, 
1545
-								msg->via1->port, received_dns)) {
1543
+	rcvd=msg->via1->received 
1544
+			|| check_via_address(&msg->rcv.src_ip, &msg->via1->host, 
1545
+						msg->via1->port, received_dns);
1546 1546
 	msg->via1->host.s[msg->via1->host.len] = backup;
1547
+	if (rcvd) {
1547 1548
 		if ((received_buf=received_builder(msg,&received_len))==0) {
1548 1549
 			LOG(L_ERR, "ERROR: build_res_buf_from_sip_req: "
1549 1550
 				"alas, received_builder failed\n");