To: vim_dev@googlegroups.com Subject: Patch 7.4.2361 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ 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. Files: src/ex_cmds2.c *** ../vim-7.4.2360/src/ex_cmds2.c 2016-09-05 22:45:25.068731124 +0200 --- src/ex_cmds2.c 2016-09-10 19:01:19.941239543 +0200 *************** *** 1143,1152 **** create_timer(long msec, int repeat) { timer_T *timer = (timer_T *)alloc_clear(sizeof(timer_T)); if (timer == NULL) return NULL; ! if (++last_timer_id < 0) /* Overflow! Might cause duplicates... */ last_timer_id = 0; timer->tr_id = last_timer_id; --- 1143,1153 ---- 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 <= prev_id) /* Overflow! Might cause duplicates... */ last_timer_id = 0; timer->tr_id = last_timer_id; *** ../vim-7.4.2360/src/version.c 2016-09-10 15:52:47.087124414 +0200 --- src/version.c 2016-09-10 19:04:46.070402320 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2361, /**/ -- hundred-and-one symptoms of being an internet addict: 227. You sleep next to your monitor. Or on top of it. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///