]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Fix the ply_window_set_text_cursor_position function
authorRay Strode <rstrode@redhat.com>
Thu, 19 Jun 2008 20:49:15 +0000 (16:49 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 19 Jun 2008 20:49:15 +0000 (16:49 -0400)
src/libplybootsplash/ply-window.c

index 3b32bf159d47d6fe412097df83b65ddedf857766..6d60a79a7d9f64937f59d4d965529008a94b8a42 100644 (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