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:
committed by
Serge Hallyn
parent
077f7b6ade
commit
964df6ed6e
+1
-4
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user