diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2023-08-06 10:40:03 +0200 |
---|---|---|
committer | Evgeniy Naydanov <109669442+en-sc@users.noreply.github.com> | 2024-01-29 13:36:27 +0300 |
commit | cdf89dcd2ee2b5b0b2b7322dd8d045ecf6fc19f3 (patch) | |
tree | e0060873b252beef2e1e0104d03a94786e4162e5 | |
parent | 88b8f2a796414a7ab94275a9b53f0c9741525109 (diff) | |
download | riscv-openocd-cdf89dcd2ee2b5b0b2b7322dd8d045ecf6fc19f3.zip riscv-openocd-cdf89dcd2ee2b5b0b2b7322dd8d045ecf6fc19f3.tar.gz riscv-openocd-cdf89dcd2ee2b5b0b2b7322dd8d045ecf6fc19f3.tar.bz2 |
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
-rw-r--r-- | src/helper/command.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index ef50ab5..9602333 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -145,8 +145,7 @@ static void script_debug(Jim_Interp *interp, unsigned int argc, Jim_Obj * const char *dbg = alloc_printf("command -"); for (unsigned i = 0; i < argc; i++) { - int len; - const char *w = Jim_GetString(argv[i], &len); + const char *w = Jim_GetString(argv[i], NULL); char *t = alloc_printf("%s %s", dbg, w); free(dbg); dbg = t; @@ -171,8 +170,7 @@ static char **script_command_args_alloc( unsigned i; for (i = 0; i < argc; i++) { - int len; - const char *w = Jim_GetString(argv[i], &len); + const char *w = Jim_GetString(argv[i], NULL); words[i] = strdup(w); if (!words[i]) { script_command_args_free(words, i); |