Module: kamailio Branch: master Commit: 03acf834a19689d6c3efcea93e48985d3e7ffc37 URL: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985d...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@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/03acf834a19689d6c3efcea93e48985d... Patch: https://github.com/kamailio/kamailio/commit/03acf834a19689d6c3efcea93e48985d...
---
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; } -