From 748979d7bda20e876806e5aab8554ee2e5a35c8c Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Sun, 27 May 2012 11:20:01 +0200 Subject: 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 file changed, 2 insertions(+), 2 deletions(-) (limited to 'com32') 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); /* -- cgit v1.2.1