From: Alan T. DeKok Date: Wed, 27 Sep 2017 15:29:08 +0000 (-0400) Subject: mash LF to NUL, so that we can parse lines individually X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97f8a79caeadead22e0bc0c47b3d57bce62b8770;p=thirdparty%2Ffreeradius-server.git mash LF to NUL, so that we can parse lines individually --- diff --git a/src/modules/proto_detail/proto_detail_file.c b/src/modules/proto_detail/proto_detail_file.c index 192237a0b1e..dd2b1460c82 100644 --- a/src/modules/proto_detail/proto_detail_file.c +++ b/src/modules/proto_detail/proto_detail_file.c @@ -208,6 +208,8 @@ redo: } if (p[1] == '\n') { + p[0] = '\0'; + p[1] = '\0'; next = p + 2; stopped_search = next; break; @@ -223,6 +225,12 @@ redo: return -1; } + /* + * Smash the \n with zero, so that each line can + * be parsed individually. + */ + p[0] = '\0'; + /* * Skip the \n\t */