diff --git a/glnx-console.c b/glnx-console.c
index bbcfe734f8fafd29af4aab94a447138e630901ac..d40702edfa73a52e76ee2852d5995be69d0df054 100644
--- a/glnx-console.c
+++ b/glnx-console.c
@@ -221,20 +221,22 @@ text_percent_internal (const char *text,
 
   if (percentage == -1)
     {
+      const guint spacelen = ncolumns - input_textlen;
       fwrite (text, 1, input_textlen, stdout);
+      printpad (spaces, n_spaces, spacelen);
     }
   else
     {
       const guint textlen = MIN (input_textlen, ncolumns - bar_min);
       const guint barlen = ncolumns - (textlen + 1);;
-      
+
       if (textlen > 0)
         {
           fwrite (text, 1, textlen, stdout);
           fputc (' ', stdout);
         }
-  
-      { 
+
+      {
         const guint nbraces = 2;
         const guint textpercent_len = 5;
         const guint bar_internal_len = barlen - nbraces - textpercent_len;
@@ -247,10 +249,6 @@ text_percent_internal (const char *text,
         fputc (']', stdout);
         fprintf (stdout, " %3d%%", percentage);
       }
-
-      { const guint spacelen = ncolumns - textlen - barlen;
-        printpad (spaces, n_spaces, spacelen);
-      }
     }
 
   fflush (stdout);