Skip to content

Commit e40d75f

Browse files
committed
patch 7.4.1831
Problem: When timer_stop() is called with a string there is no proper error message. Solution: Require getting a number. (Bjorn Linse)
1 parent 73a733e commit e40d75f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/eval.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20733,8 +20733,14 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
2073320733
static void
2073420734
f_timer_stop(typval_T *argvars, typval_T *rettv UNUSED)
2073520735
{
20736-
timer_T *timer = find_timer(get_tv_number(&argvars[0]));
20736+
timer_T *timer;
2073720737

20738+
if (argvars[0].v_type != VAR_NUMBER)
20739+
{
20740+
EMSG(_(e_number_exp));
20741+
return;
20742+
}
20743+
timer = find_timer(get_tv_number(&argvars[0]));
2073820744
if (timer != NULL)
2073920745
stop_timer(timer);
2074020746
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1831,
756758
/**/
757759
1830,
758760
/**/

0 commit comments

Comments
 (0)