aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-08-30 13:38:15 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2023-09-04 14:24:36 +0400
commit893fe23e7dc675d650a4da710efe62a53c2341ee (patch)
treedf8b117096ed88135dfac781fd87f9f9499b712f
parent9cb737b77d9cc43a9bed305cbb105928a3dda54b (diff)
downloadqemu-893fe23e7dc675d650a4da710efe62a53c2341ee.zip
qemu-893fe23e7dc675d650a4da710efe62a53c2341ee.tar.gz
qemu-893fe23e7dc675d650a4da710efe62a53c2341ee.tar.bz2
ui/console: minor stylistic changes
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>
-rw-r--r--ui/console.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ui/console.c b/ui/console.c
index 4ee3b77..b1d375e 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -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++;