diff options
Diffstat (limited to 'com32')
-rw-r--r-- | com32/modules/cmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/com32/modules/cmd.c b/com32/modules/cmd.c index f0b0a968..e1d646b5 100644 --- a/com32/modules/cmd.c +++ b/com32/modules/cmd.c @@ -18,7 +18,6 @@ #include <string.h> #include <alloca.h> -#include <console.h> #include <com32.h> int main(int argc, const char *argv[]) @@ -28,15 +27,17 @@ int main(int argc, const char *argv[]) char *tmp; int i; - openconsole(&dev_stdcon_r, &dev_stdcon_w); - for (i = 1; i < argc; i++) len += strlen(argv[i]) + 1; tmp = cmd = alloca(len); - for (i = 1; i < argc; i++) - tmp += sprintf(tmp, "%s%s", argv[i], (i == argc-1) ? "" : " "); + for (i = 1; i < argc; i++) { + tmp = strpcpy(tmp, argv[i]); + if (i != argc-1) + *tmp++ = ' '; + } + *tmp = '\0'; syslinux_run_command(cmd); } |