lib/, src/: Use strchrnul(3) instead of its pattern

In the files where #include <string.h> is missing, add it, and sort the
includes.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-05-12 23:44:35 +02:00
committed by Serge Hallyn
parent 077f7b6ade
commit 964df6ed6e
12 changed files with 55 additions and 75 deletions
+1 -4
View File
@@ -360,10 +360,7 @@ static void get_defaults (void)
* values are used, everything else can be ignored.
*/
while (fgets (buf, sizeof buf, fp) == buf) {
cp = strrchr (buf, '\n');
if (NULL != cp) {
*cp = '\0';
}
*strchrnul(buf, '\n') = '\0';
cp = strchr (buf, '=');
if (NULL == cp) {