Module: sems
Branch: master
Commit: 97461c3c32b9090f7d78452dae79e545405651a2
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=97461c3c32b9090f7d78452dae79e545405651a2

Author: Stefan Sayer <[email protected]>
Committer: Stefan Sayer <[email protected]>
Date:   Fri May  6 19:20:09 2011 +0200

b/f: proper skip_line fix

---

 core/AmB2BSession.cpp |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/core/AmB2BSession.cpp b/core/AmB2BSession.cpp
index 4d78c24..844ace4 100644
--- a/core/AmB2BSession.cpp
+++ b/core/AmB2BSession.cpp
@@ -530,16 +530,18 @@ void AmB2BSession::saveSessionDescription(const string& 
content_type,
   size_t cmp_body_length = body.length();
 
 #define skip_line                                              \
-  if (cmp_body_length) {                                       \
-    while (cmp_body_length-- && *cmp_body_begin != '\n')       \
+    while (cmp_body_length && *cmp_body_begin != '\n') {       \
       cmp_body_begin++;                                                \
-    cmp_body_begin++;                                          \
-  }
+      cmp_body_length--;                                       \
+    }                                                          \
+    if (cmp_body_length) {                                     \
+      cmp_body_begin++;                                                \
+      cmp_body_length--;                                       \
+    }
 
   if (body.length() && content_type == SIP_APPLICATION_SDP) {
     // for SDP, skip v and o line
     // (o might change even if SDP unchanged)
-
     skip_line;
     skip_line;
   }

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to