From 50b4c0aef9ca56cf5faf361c9491fc141026ce49 Mon Sep 17 00:00:00 2001 From: Thomas Sader Date: Sat, 20 Jul 2024 12:06:42 +0200 Subject: [PATCH] Fix utimer name duplication check Found by: ZarTek Patch by: thommey Fixes #1655 --- src/tclmisc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tclmisc.c b/src/tclmisc.c index bbfdb5299..f2d713a5b 100644 --- a/src/tclmisc.c +++ b/src/tclmisc.c @@ -234,7 +234,7 @@ static int tcl_binds STDVAR return TCL_OK; } -int check_timer_syntax(Tcl_Interp *irp, int argc, char *argv[]) { +int check_timer_syntax(Tcl_Interp *irp, int argc, char *argv[], tcl_timer_t *stack) { char *endptr; long val; @@ -257,7 +257,7 @@ int check_timer_syntax(Tcl_Interp *irp, int argc, char *argv[]) { return 1; } /* Check for existing timers by same name */ - if (find_timer(timer, argv[4])) { + if (find_timer(stack, argv[4])) { Tcl_AppendResult(irp, "timer already exists by that name", NULL); return 1; } @@ -272,7 +272,7 @@ static int tcl_timer STDVAR BADARGS(3, 5, " minutes command ?count ?name??"); - if (check_timer_syntax(irp, argc, argv)) { + if (check_timer_syntax(irp, argc, argv, timer)) { return TCL_ERROR; } x = add_timer(&timer, atoi(argv[1]), (argc >= 4 ? atoi(argv[3]) : 1), @@ -291,7 +291,7 @@ static int tcl_utimer STDVAR BADARGS(3, 5, " seconds command ?count ?name??"); - if (check_timer_syntax(irp, argc, argv)) { + if (check_timer_syntax(irp, argc, argv, utimer)) { return TCL_ERROR; } x = add_timer(&utimer, atoi(argv[1]), (argc == 4 ? atoi(argv[3]) : 1),