helper/command: drop unused variables
In both functions script_debug() and script_command_args_alloc() the variable len is never used, and Jim_GetString() does not mandate it. Drop the variable and pass NULL to Jim_GetString(). Change-Id: I754b27a59c6087cde729496be42609d2a7145b0c Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8053 Tested-by: jenkins
This commit is contained in:
parent
88b8f2a796
commit
cdf89dcd2e
|
@ -145,8 +145,7 @@ static void script_debug(Jim_Interp *interp, unsigned int argc, Jim_Obj * const
|
||||||
|
|
||||||
char *dbg = alloc_printf("command -");
|
char *dbg = alloc_printf("command -");
|
||||||
for (unsigned i = 0; i < argc; i++) {
|
for (unsigned i = 0; i < argc; i++) {
|
||||||
int len;
|
const char *w = Jim_GetString(argv[i], NULL);
|
||||||
const char *w = Jim_GetString(argv[i], &len);
|
|
||||||
char *t = alloc_printf("%s %s", dbg, w);
|
char *t = alloc_printf("%s %s", dbg, w);
|
||||||
free(dbg);
|
free(dbg);
|
||||||
dbg = t;
|
dbg = t;
|
||||||
|
@ -171,8 +170,7 @@ static char **script_command_args_alloc(
|
||||||
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
int len;
|
const char *w = Jim_GetString(argv[i], NULL);
|
||||||
const char *w = Jim_GetString(argv[i], &len);
|
|
||||||
words[i] = strdup(w);
|
words[i] = strdup(w);
|
||||||
if (!words[i]) {
|
if (!words[i]) {
|
||||||
script_command_args_free(words, i);
|
script_command_args_free(words, i);
|
||||||
|
|
Loading…
Reference in New Issue