syslog-ng source
find-crlf.c File Reference
#include "find-crlf.h"
#include <string.h>
Include dependency graph for find-crlf.c:

Functions

gchar * find_cr_or_lf_or_nul (gchar *s, gsize n)
 

Function Documentation

◆ find_cr_or_lf_or_nul()

gchar* find_cr_or_lf_or_nul ( gchar *  s,
gsize  n 
)

This is an optimized version of finding either a CR or LF or NUL character in a buffer. It is used to find these line terminators in syslog traffic.

It uses an algorithm very similar to what there's in libc memchr/strchr.