Skip to content

Commit

Permalink
ui/console: minor stylistic changes
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-42-marcandre.lureau@redhat.com>
  • Loading branch information
elmarco committed Sep 4, 2023
1 parent 9cb737b commit 893fe23
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ui/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,20 +427,18 @@ static void text_console_resize(QemuTextConsole *t)
t->width = w;
t->height = h;

w1 = last_width;
if (t->width < w1)
w1 = t->width;
w1 = MIN(t->width, last_width);

cells = g_new(TextCell, t->width * t->total_height + 1);
for(y = 0; y < t->total_height; y++) {
for (y = 0; y < t->total_height; y++) {
c = &cells[y * t->width];
if (w1 > 0) {
c1 = &t->cells[y * last_width];
for(x = 0; x < w1; x++) {
for (x = 0; x < w1; x++) {
*c++ = *c1++;
}
}
for(x = w1; x < t->width; x++) {
for (x = w1; x < t->width; x++) {
c->ch = ' ';
c->t_attrib = TEXT_ATTRIBUTES_DEFAULT;
c++;
Expand Down

0 comments on commit 893fe23

Please sign in to comment.