projects
/
platform
/
upstream
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd1a23a
)
hdt: Fixing argument mgmt in cli
author
Erwan Velu
<erwanaliasr1@gmail.com>
Sun, 27 May 2012 09:20:01 +0000
(11:20 +0200)
committer
Erwan Velu
<erwanaliasr1@gmail.com>
Sun, 27 May 2012 09:20:01 +0000
(11:20 +0200)
Sizeof(char *) is definetly wrong for getting the length of a string.
com32/hdt/hdt-cli.c
patch
|
blob
|
history
diff --git
a/com32/hdt/hdt-cli.c
b/com32/hdt/hdt-cli.c
index
85bd13f
..
3dd982e
100644
(file)
--- 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(s
izeof
(pch) * sizeof(char));
- strlcpy(argv[argc_iter], pch, s
izeof
(pch));
+ argv[argc_iter] = malloc(s
trlen
(pch) * sizeof(char));
+ strlcpy(argv[argc_iter], pch, s
trlen
(pch));
argc_iter++;
pch = strtok(NULL, CLI_SPACE);
/*