changeset 9093:ad9322b525e1 v7.4.1831

commit https://github.com/vim/vim/commit/e40d75f6ef73095286b66e546c70ff6f045e009d Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 15 18:00:19 2016 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Sun, 15 May 2016 18:15:06 +0200
parents 2d2797fc5f11
children adf5f3bcb6aa
files src/eval.c src/version.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -20733,8 +20733,14 @@ f_timer_start(typval_T *argvars, typval_
     static void
 f_timer_stop(typval_T *argvars, typval_T *rettv UNUSED)
 {
-    timer_T *timer = find_timer(get_tv_number(&argvars[0]));
-
+    timer_T *timer;
+
+    if (argvars[0].v_type != VAR_NUMBER)
+    {
+         EMSG(_(e_number_exp));
+         return;
+    }
+    timer = find_timer(get_tv_number(&argvars[0]));
     if (timer != NULL)
 	stop_timer(timer);
 }
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1831,
+/**/
     1830,
 /**/
     1829,