Skip to content

Commit ee39ef0

Browse files
committed
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.
1 parent 80c3fd7 commit ee39ef0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ex_cmds2.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,10 +1143,11 @@ free_timer(timer_T *timer)
11431143
create_timer(long msec, int repeat)
11441144
{
11451145
timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T));
1146+
long prev_id = last_timer_id;
11461147

11471148
if (timer == NULL)
11481149
return NULL;
1149-
if (++last_timer_id < 0)
1150+
if (++last_timer_id <= prev_id)
11501151
/* Overflow! Might cause duplicates... */
11511152
last_timer_id = 0;
11521153
timer->tr_id = last_timer_id;

src/version.c

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

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2361,
766768
/**/
767769
2360,
768770
/**/

0 commit comments

Comments
 (0)