Browse code

made fix with padding now

Jiri Kuthan authored on 09/09/2002 12:41:37
Showing 2 changed files
... ...
@@ -217,6 +217,12 @@ void crcitt_string_array( char *dst, str src[], int size )
217 217
 		/* bug ... printed ccitt value longer than CRC32_LEN */
218 218
 		LOG(L_CRIT, "ERROR: crcitt_string_array: string conversion incomplete\n");
219 219
 	}
220
+	/* padding */
221
+	while( str_len ) {
222
+		*dst='0';
223
+		dst++;
224
+		str_len--;
225
+	}
220 226
 }
221 227
 		
222 228
 				
... ...
@@ -557,13 +557,13 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text,
557 557
 	struct hdr_field  *hdr;
558 558
 	struct lump_rpl   *lump;
559 559
 	int               i;
560
-	str               *tag_str;
561 560
 	char              backup;
562 561
 	char              *received_buf;
563 562
 	int               received_len;
564 563
 	char              *warning;
565 564
 	unsigned int      warning_len;
566 565
 	int r;
566
+	str to_tag;
567 567
 
568 568
 	received_buf=0;
569 569
 	received_len=0;
... ...
@@ -606,8 +606,9 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text,
606 606
 			case HDR_TO:
607 607
 				if (new_tag)
608 608
 				{
609
-					if (get_to(msg)->tag_value.s )
610
-						len+=new_tag_len-get_to(msg)->tag_value.len;
609
+					to_tag=get_to(msg)->tag_value;
610
+					if (to_tag.s )
611
+						len+=new_tag_len-to_tag.len;
611 612
 					else
612 613
 						len+=new_tag_len+5/*";tag="*/;
613 614
 				}
... ...
@@ -668,14 +669,13 @@ char * build_res_buf_from_sip_req( unsigned int code, char *text,
668 668
 		{
669 669
 			case HDR_TO:
670 670
 				if (new_tag){
671
-					if (get_to(msg)->tag_value.s ) {
672
-						tag_str =&(get_to(msg)->tag_value);
671
+					if (to_tag.s ) {
673 672
 						append_str_trans( p, hdr->name.s ,
674
-							tag_str->s-hdr->name.s,msg);
673
+							to_tag.s-hdr->name.s,msg);
675 674
 						append_str( p, new_tag,new_tag_len,msg);
676
-						append_str_trans( p,tag_str->s+tag_str->len,
675
+						append_str_trans( p,to_tag.s+to_tag.len,
677 676
 							((hdr->body.s+hdr->body.len )-
678
-							(tag_str->s+tag_str->len)),msg);
677
+							(to_tag.s+to_tag.len)),msg);
679 678
 						append_str( p, CRLF,CRLF_LEN,msg);
680 679
 					}else{
681 680
 						append_str_trans( p, hdr->name.s ,