[Freeswitch-svn] [commit] r8610 - in freeswitch/trunk/libs/sofia-sip: . libsofia-sip-ua/sdp

Freeswitch SVN mikej at freeswitch.org
Sun May 25 09:54:06 EDT 2008


Author: mikej
Date: Sun May 25 09:54:06 2008
New Revision: 8610

Modified:
   freeswitch/trunk/libs/sofia-sip/.update
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
   freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c

Log:
Tue May 20 09:29:34 EDT 2008  Pekka.Pessi at nokia.com
  * sdp: Fixed klocwork issues.



Modified: freeswitch/trunk/libs/sofia-sip/.update
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/.update	(original)
+++ freeswitch/trunk/libs/sofia-sip/.update	Sun May 25 09:54:06 2008
@@ -1 +1 @@
-Sun May 25 09:52:56 EDT 2008
+Sun May 25 09:53:58 EDT 2008

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c	Sun May 25 09:54:06 2008
@@ -98,7 +98,7 @@
 
 /* Internal prototypes */
 static void parse_message(sdp_parser_t *p);
-static void parsing_error(sdp_parser_t *p, char const *fmt, ...);
+static int parsing_error(sdp_parser_t *p, char const *fmt, ...);
 
 /** Parse an SDP message.
  *
@@ -357,7 +357,7 @@
   if (!STRICT(p))
     strip = SPACE TAB;		/* skip initial whitespace */
   else
-    strip = NULL;
+    strip = "";
 
   p->pr_ok = 1;
   p->pr_session->sdp_size = sizeof(p->pr_session);
@@ -550,18 +550,15 @@
   sdp_media_t *m;
 
   if (!p || !p->pr_ok)
-    ;
+    return -1;
   else if (sdp->sdp_version[0] != 0)
-    parsing_error(p, "Incorrect version");
+    return parsing_error(p, "Incorrect version");
   else if (!sdp->sdp_origin)
-    parsing_error(p, "No o= present");
+    return parsing_error(p, "No o= present");
   else if (p->pr_strict && !sdp->sdp_subject)
-    parsing_error(p, "No s= present");
+    return parsing_error(p, "No s= present");
   else if (p->pr_strict && !sdp->sdp_time)
-    parsing_error(p, "No t= present");
-
-  if (!p->pr_ok)
-    return -1;
+    return parsing_error(p, "No t= present");
 
   /* If there is no session level c= check that one exists for all media */
   /* c= line may be missing if this is a RTSP description */
@@ -1707,7 +1704,7 @@
   if (!STRICT(p))
     strip = SPACE TAB;		/* skip initial whitespace */
   else
-    strip = NULL;
+    strip = "";
   
   for (;
        record && p->pr_ok;
@@ -1846,7 +1843,7 @@
   size_t n;
   char *retval = *message;
 
-  if (strip)
+  if (strip[0])
     retval += strspn(retval, strip);
 
   n = strcspn(retval, sep);
@@ -1867,7 +1864,7 @@
   return retval;
 }
 
-static void parsing_error(sdp_parser_t *p, char const *fmt, ...)
+static int parsing_error(sdp_parser_t *p, char const *fmt, ...)
 {
   int n;
   va_list ap;
@@ -1878,6 +1875,8 @@
   va_end(ap);
 
   p->pr_ok = 0;
+
+  return -1;
 }
 
 static void parse_alloc_error(sdp_parser_t *p, const char *typename)

Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c	(original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/sdp/sdp_print.c	Sun May 25 09:54:06 2008
@@ -681,17 +681,15 @@
 static void printing_error(sdp_printer_t *p, const char *fmt, ...)
 {
   va_list ap;
-  va_start(ap, fmt); 
-  
+
   if (p->pr_ok) {
     int n;
-
+    va_start(ap, fmt);
     n = vsnprintf(p->pr_buffer, p->pr_bsiz, fmt, ap);
-    
-    p->pr_ok = 0;
+    va_end(ap);
   }
 
-  va_end(ap);
+  p->pr_ok = 0;
 }
 
 static void sdp_printf(sdp_printer_t *p, const char *fmt, ...)



More information about the Freeswitch-svn mailing list