[syslinux:master] hdt: Fixing argument mgmt in cli
syslinux-bot for Erwan Velu
erwanaliasr1 at gmail.com
Sun May 27 13:00:07 PDT 2012
Commit-ID: 748979d7bda20e876806e5aab8554ee2e5a35c8c
Gitweb: http://www.syslinux.org/commit/748979d7bda20e876806e5aab8554ee2e5a35c8c
Author: Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Sun, 27 May 2012 11:20:01 +0200
Committer: Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Sun, 27 May 2012 11:20:01 +0200
hdt: Fixing argument mgmt in cli
Sizeof(char *) is definetly wrong for getting the length of a string.
---
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 85bd13f..3dd982e 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);
/*
More information about the Syslinux-commits
mailing list