From 136dfeb41a2fe7b21a2071132d8d3dee2fb0148b Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Mon, 5 May 2008 15:55:20 -0300 Subject: [PATCH] And I mean it! Signed-off-by: Claudio Matsuoka --- finit-alt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/finit-alt.c b/finit-alt.c index 12bf56c7..b2e46a4f 100644 --- a/finit-alt.c +++ b/finit-alt.c @@ -164,7 +164,7 @@ int main() i = strlen(line); if (i && line[i - 1] == '\n') - line[i] = 0; + line[i - 1] = 0; if (debug) printf("conf: %s\n", line); @@ -173,20 +173,21 @@ int main() x += 6; strcpy(cmd, "/sbin/e2fsck -C -p "); c = cmd + strlen(cmd); - while (x && *x != ' ') *c++ = *x++; + while (x && *x && *x != ' ') *c++ = *x++; system(cmd); + continue; } if ((x = strstr(line, "user ")) == line) { x += 5; c = username; - while (x && *x != ' ') *c++ = *x++; + while (x && *x && *x != ' ') *c++ = *x++; continue; } if ((x = strstr(line, "module ")) == line) { x += 7; - strcpy(cmd, "/sbin/insmod "); + strcpy(cmd, "/sbin/modprobe "); c = cmd + strlen(cmd); - while (x && *x != ' ') *c++ = *x++; + while (x && *x && *x != ' ') *c++ = *x++; system(cmd); continue; }