From 8f4162f82af7186a49bc697a43b549b7e3146385 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 24 May 2014 17:43:45 +0200 Subject: [PATCH] inittab: strip trailing whitespace (especially newline) Signed-off-by: Felix Fietkau --- inittab.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inittab.c b/inittab.c index a9c3535..677ec47 100644 --- a/inittab.c +++ b/inittab.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -258,6 +259,11 @@ void procd_inittab(void) char *tags[TAG_PROCESS + 1]; char *tok; int i; + int len = strlen(line); + + while (isspace(line[len - 1])) + len--; + line[len] = 0; if (*line == '#') continue; -- 2.25.1