diff options
author | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-02-09 06:05:01 +0000 |
---|---|---|
committer | erik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-02-09 06:05:01 +0000 |
commit | 7a3e4997078f713308f0f68618467d029da86c49 (patch) | |
tree | fa1366c513e765680f747e802ce864f136d8a175 /init | |
parent | d9495ce9e5d2c3c618e81ba27e75e800be76edd6 (diff) | |
download | busybox-w32-7a3e4997078f713308f0f68618467d029da86c49.tar.gz busybox-w32-7a3e4997078f713308f0f68618467d029da86c49.tar.bz2 busybox-w32-7a3e4997078f713308f0f68618467d029da86c49.zip |
Fix a possible /linuxrc crash.
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@360 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c index 2f2203b38..0157873ab 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -879,7 +879,8 @@ extern int init_main(int argc, char **argv) | |||
879 | 879 | ||
880 | /* Fix up argv[0] to be certain we claim to be init */ | 880 | /* Fix up argv[0] to be certain we claim to be init */ |
881 | strncpy(argv[0], "init", strlen(argv[0])+1); | 881 | strncpy(argv[0], "init", strlen(argv[0])+1); |
882 | strncpy(argv[1], "\0", strlen(argv[1])+1); | 882 | if (argc > 1) |
883 | strncpy(argv[1], "\0", strlen(argv[1])+1); | ||
883 | 884 | ||
884 | /* Now run everything that needs to be run */ | 885 | /* Now run everything that needs to be run */ |
885 | 886 | ||