From 88bca53c1fefd529dc6664a6aac1c3f5ea5f601b Mon Sep 17 00:00:00 2001 From: Erik Troan Date: Mon, 9 Aug 1999 21:29:34 +0000 Subject: parameters weren't passed properly --- isys/otherinsmod.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'isys') diff --git a/isys/otherinsmod.c b/isys/otherinsmod.c index f052ed16c..190a36cf5 100644 --- a/isys/otherinsmod.c +++ b/isys/otherinsmod.c @@ -106,14 +106,18 @@ int insmod(char * modName, char ** args) { pid_t child; int status; - argc = 2; + + argc = 0; for (argv = args; argv && *argv; argv++, argc++); - argv = malloc(sizeof(*argv) * (argc + 1)); + argv = alloca(sizeof(*argv) * (argc + 3)); argv[0] = "/bin/insmod"; argv[1] = modName; if (args) - memcpy(argv + 2, args, argc - 1); + memcpy(argv + 2, args, sizeof(*args) * argc); + argv[argc + 2] = NULL; + + argc += 2; if ((child = fork()) == 0) { exit(ourInsmodCommand(argc, argv)); -- cgit