From: Felix Fietkau Date: Sat, 24 May 2014 15:43:45 +0000 (+0200) Subject: inittab: strip trailing whitespace (especially newline) X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8f4162f82af7186a49bc697a43b549b7e3146385;p=oweals%2Fprocd.git inittab: strip trailing whitespace (especially newline) Signed-off-by: Felix Fietkau --- 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;