From ee39ef0b93d31763d05e54ba99801e3f1a254c0d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 10 Sep 2016 19:17:42 +0200 Subject: [PATCH] patch 7.4.2361 Problem: Checking for last_timer_id to overflow is not reliable. (Ozaki Kiichi) Solution: Check for the number not going up. --- src/ex_cmds2.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 8df67536c..b8d8dca9e 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1143,10 +1143,11 @@ free_timer(timer_T *timer) create_timer(long msec, int repeat) { timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T)); + long prev_id = last_timer_id; if (timer == NULL) return NULL; - if (++last_timer_id < 0) + if (++last_timer_id <= prev_id) /* Overflow! Might cause duplicates... */ last_timer_id = 0; timer->tr_id = last_timer_id; diff --git a/src/version.c b/src/version.c index a71647b90..9a6851e55 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2361, /**/ 2360, /**/ -- 2.40.0