Browse code

core: parser - clang format parser_f.c

(cherry picked from commit 03acf834a19689d6c3efcea93e48985d3e7ffc37)

Daniel-Constantin Mierla authored on 16/12/2021 08:44:54
Showing 1 changed files
... ...
@@ -15,8 +15,8 @@
15 15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 16
  * GNU General Public License for more details.
17 17
  *
18
- * You should have received a copy of the GNU General Public License 
19
- * along with this program; if not, write to the Free Software 
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program; if not, write to the Free Software
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 21
  *
22 22
  */
... ...
@@ -28,22 +28,27 @@
28 28
  */
29 29
 
30 30
 
31
-#include  "parser_f.h"
31
+#include "parser_f.h"
32 32
 #include "../ut.h"
33 33
 
34 34
 /** @brief returns pointer to next line or after the end of buffer */
35
-char* eat_line(char* buffer, unsigned int len)
35
+char *eat_line(char *buffer, unsigned int len)
36 36
 {
37
-	char* nl;
37
+	char *nl;
38 38
 
39 39
 	/* jku .. replace for search with a library function; not conforming
40 40
  		  as I do not care about CR
41 41
 	*/
42
-	nl=(char *)q_memchr( buffer, '\n', len );
43
-	if ( nl ) { 
44
-		if ( nl + 1 < buffer+len)  nl++;
45
-		if (( nl+1<buffer+len) && * nl=='\r')  nl++;
46
-	} else  nl=buffer+len;
42
+	nl = (char *)q_memchr(buffer, '\n', len);
43
+	if(nl) {
44
+		if(nl + 1 < buffer + len) {
45
+			nl++;
46
+		}
47
+		if((nl + 1 < buffer + len) && *nl == '\r') {
48
+			nl++;
49
+		}
50
+	} else {
51
+		nl = buffer + len;
52
+	}
47 53
 	return nl;
48 54
 }
49
-