Fix the ply_window_set_text_cursor_position function

This commit is contained in:
Ray Strode 2008-06-19 16:49:15 -04:00
parent 2261967587
commit 73bcd971fe

View file

@ -53,7 +53,7 @@
#define KEY_RETURN '\r'
#define KEY_BACKSPACE '\177'
#define MOVE_CURSOR_SEQUNCE(column,row) "\033[f"#row","#column
#define MOVE_CURSOR_SEQUNCE "\033[%d;%df"
struct _ply_window
{
@ -446,9 +446,12 @@ ply_window_set_text_cursor_position (ply_window_t *window,
int column,
int row)
{
write (window->tty_fd,
MOVE_CURSOR_SEQUNCE(row,column),
strlen (MOVE_CURSOR_SEQUNCE(row,column)));
char *sequence;
sequence = NULL;
asprintf (&sequence, MOVE_CURSOR_SEQUNCE, row, column);
write (window->tty_fd, sequence, strlen (sequence));
free (sequence);
}
static void