diff options
author | Erwan Velu <erwanaliasr1@gmail.com> | 2012-05-27 11:20:01 +0200 |
---|---|---|
committer | Erwan Velu <erwanaliasr1@gmail.com> | 2012-05-27 11:20:01 +0200 |
commit | 748979d7bda20e876806e5aab8554ee2e5a35c8c (patch) | |
tree | cf6a36f222e0311377bbfae68f8e1ddc70b9032e | |
parent | cd1a23a064f4da78618a9335edd398d12810b848 (diff) | |
download | syslinux-748979d7bda20e876806e5aab8554ee2e5a35c8c.tar.gz syslinux-748979d7bda20e876806e5aab8554ee2e5a35c8c.tar.xz syslinux-748979d7bda20e876806e5aab8554ee2e5a35c8c.zip |
hdt: Fixing argument mgmt in cli
Sizeof(char *) is definetly wrong for getting the length of a string.
-rw-r--r-- | com32/hdt/hdt-cli.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 85bd13ff..3dd982ef 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -391,8 +391,8 @@ static void parse_command_line(char *line, char **command, char **module, pch = strtok(line + args_pos, CLI_SPACE); while (pch != NULL) { dprintf("CLI DEBUG parse: argv[%d] = %s\n", argc_iter, pch); - argv[argc_iter] = malloc(sizeof(pch) * sizeof(char)); - strlcpy(argv[argc_iter], pch, sizeof(pch)); + argv[argc_iter] = malloc(strlen(pch) * sizeof(char)); + strlcpy(argv[argc_iter], pch, strlen(pch)); argc_iter++; pch = strtok(NULL, CLI_SPACE); /* |