view runtime/tools/blink.c @ 29704:5b3a88601317 v9.0.0192

patch 9.0.0192: possible invalid memory access when 'cmdheight' is zero Commit: https://github.com/vim/vim/commit/fdc5d17d58cc9c9edc9fb2816e1afaabc531bf1e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Aug 11 15:52:14 2022 +0100 patch 9.0.0192: possible invalid memory access when 'cmdheight' is zero Problem: Possible invalid memory access when 'cmdheight' is zero. (Martin Tournoij) Solution: Avoid going over the end of w_lines[] when w_height is Rows. (closes #10882)
author Bram Moolenaar <Bram@vim.org>
date Thu, 11 Aug 2022 17:00:03 +0200
parents 64035abb986b
children
line wrap: on
line source

/*
 * An extremely simple program to make the cursor blink in an xterm.
 * This is useful when the cursor is hard to spot in a highlighted file.
 * Start in the background: "blink&"  Stop by killing it.
 * Bram Moolenaar  980109  (based on an idea from John Lange).
 */

#include <stdio.h>
#include <unistd.h>

	int
main(void)
{
	while (1)
	{
		printf("\e[?25h");
		fflush(stdout);
		usleep(400000);		/* on time */
		printf("\e[?25l");
		fflush(stdout);
		usleep(250000);		/* off time */
	}
	return 0;
}