ui/console: minor stylistic changes
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 30 Aug 2023 09:38:15 +0000 (13:38 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 4 Sep 2023 10:24:36 +0000 (14:24 +0400)
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>

ui/console.c

index 4ee3b77568106edf18baaa73977924e151ab8d39..b1d375ecb412adc061d428ea0a2bf7c2067c9203 100644 (file)
@@ -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++;