Răsfoiți Sursa

topos: proper check if the last char in headr value is eol

Daniel-Constantin Mierla 9 ani în urmă
părinte
comite
b933550a50
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      modules/topos/tps_msg.c

+ 1 - 1
modules/topos/tps_msg.c

@@ -166,7 +166,7 @@ int tps_add_headers(sip_msg_t *msg, str *hname, str *hbody, int hpos)
 	memcpy(hs.s + hname->len + 2, hbody->s, hbody->len);
 	memcpy(hs.s + hname->len + 2, hbody->s, hbody->len);
 
 
 	/* add end of header if not present */
 	/* add end of header if not present */
-	if(hs.s[hname->len + 2 + hbody->len]!='\n') {
+	if(hs.s[hname->len + 2 + hbody->len - 1]!='\n') {
 		hs.s[hname->len + 2 + hbody->len] = '\r';
 		hs.s[hname->len + 2 + hbody->len] = '\r';
 		hs.s[hname->len + 2 + hbody->len+1] = '\n';
 		hs.s[hname->len + 2 + hbody->len+1] = '\n';
 		hs.len += 2;
 		hs.len += 2;