浏览代码

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

Daniel-Constantin Mierla 9 年之前
父节点
当前提交
b933550a50
共有 1 个文件被更改,包括 1 次插入1 次删除
  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);
 
 	/* 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+1] = '\n';
 		hs.len += 2;