|
@@ -648,7 +648,7 @@ static void vc_putchar(VCChardev *vc, int ch)
|
|
QemuTextConsole *s = vc->console;
|
|
QemuTextConsole *s = vc->console;
|
|
int i;
|
|
int i;
|
|
int x, y;
|
|
int x, y;
|
|
- char response[40];
|
|
|
|
|
|
+ g_autofree char *response = NULL;
|
|
|
|
|
|
switch(vc->state) {
|
|
switch(vc->state) {
|
|
case TTY_STATE_NORM:
|
|
case TTY_STATE_NORM:
|
|
@@ -821,7 +821,7 @@ static void vc_putchar(VCChardev *vc, int ch)
|
|
break;
|
|
break;
|
|
case 6:
|
|
case 6:
|
|
/* report cursor position */
|
|
/* report cursor position */
|
|
- sprintf(response, "\033[%d;%dR",
|
|
|
|
|
|
+ response = g_strdup_printf("\033[%d;%dR",
|
|
(s->y_base + s->y) % s->total_height + 1,
|
|
(s->y_base + s->y) % s->total_height + 1,
|
|
s->x + 1);
|
|
s->x + 1);
|
|
vc_respond_str(vc, response);
|
|
vc_respond_str(vc, response);
|