aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc Schink <dev@zapb.de>2021-06-22 12:59:01 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2022-03-05 13:23:33 +0000
commit4a4ca07da7b53e589afe2f79d03787d89faf1d33 (patch)
tree3b8bd9755ca12d7e5f3c40804f9261ce572e5ac2 /src
parent29e2a7451638d5706daf13b12211b49baafa3c42 (diff)
downloadriscv-openocd-4a4ca07da7b53e589afe2f79d03787d89faf1d33.zip
riscv-openocd-4a4ca07da7b53e589afe2f79d03787d89faf1d33.tar.gz
riscv-openocd-4a4ca07da7b53e589afe2f79d03787d89faf1d33.tar.bz2
target/arm_tpiu: Fix 'tpiu create' parameter check
The current implementation crashes when executing 'tpiu create' without an object name due to an invalid memory access. Pass 'argv' instead 'goi.argv' to fix the problem. While at it, match the style of the error message to the style used for other Tcl commands. Especially, make the 'name' parameter mandatory. Change-Id: Ib2b233f8556934af61608ae93d6405585c2c40b7 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: https://review.openocd.org/c/openocd/+/6329 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Diffstat (limited to 'src')
-rw-r--r--src/target/arm_tpiu_swo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c
index 387ad9e..3738a3b 100644
--- a/src/target/arm_tpiu_swo.c
+++ b/src/target/arm_tpiu_swo.c
@@ -916,7 +916,7 @@ static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const
struct jim_getopt_info goi;
jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 1) {
- Jim_WrongNumArgs(goi.interp, 1, goi.argv, "?name? ..options...");
+ Jim_WrongNumArgs(interp, 1, argv, "name ?option option ...?");
return JIM_ERR;
}