[sr-dev] git:master:03acf834: core: parser - clang format parser_f.c

Daniel-Constantin Mierla miconda at gmail.com
Thu Dec 16 10:02:44 CET 2021


Module: kamailio
Branch: master
Commit: 03acf834a19689d6c3efcea93e48985d3e7ffc37
URL: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985d3e7ffc37

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-12-16T09:44:54+01:00

core: parser - clang format parser_f.c

---

Modified: src/core/parser/parser_f.c

---

Diff:  https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985d3e7ffc37.diff
Patch: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985d3e7ffc37.patch

---

diff --git a/src/core/parser/parser_f.c b/src/core/parser/parser_f.c
index f1a532fd6f..c124f68cc5 100644
--- a/src/core/parser/parser_f.c
+++ b/src/core/parser/parser_f.c
@@ -15,8 +15,8 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License 
- * along with this program; if not, write to the Free Software 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
@@ -28,22 +28,27 @@
  */
 
 
-#include  "parser_f.h"
+#include "parser_f.h"
 #include "../ut.h"
 
 /** @brief returns pointer to next line or after the end of buffer */
-char* eat_line(char* buffer, unsigned int len)
+char *eat_line(char *buffer, unsigned int len)
 {
-	char* nl;
+	char *nl;
 
 	/* jku .. replace for search with a library function; not conforming
  		  as I do not care about CR
 	*/
-	nl=(char *)q_memchr( buffer, '\n', len );
-	if ( nl ) { 
-		if ( nl + 1 < buffer+len)  nl++;
-		if (( nl+1<buffer+len) && * nl=='\r')  nl++;
-	} else  nl=buffer+len;
+	nl = (char *)q_memchr(buffer, '\n', len);
+	if(nl) {
+		if(nl + 1 < buffer + len) {
+			nl++;
+		}
+		if((nl + 1 < buffer + len) && *nl == '\r') {
+			nl++;
+		}
+	} else {
+		nl = buffer + len;
+	}
 	return nl;
 }
-




More information about the sr-dev mailing list