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.
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 8df6753..b8d8dca 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -1143,10 +1143,11 @@
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;