]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix compilation error
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 6 Jan 2010 21:19:28 +0000 (22:19 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 6 Jan 2010 21:19:28 +0000 (22:19 +0100)
gfxmenu/gui_progress_bar.c

index 6a7f439627a4416a2cb3442ecf6b3106bebbcfc2..550b5d43c0d1bdbfb4738d92d24ba83beffa3a58 100644 (file)
@@ -163,14 +163,15 @@ draw_text (grub_gui_progress_bar_t self)
       grub_video_color_t text_color = grub_gui_map_color (self->text_color);
       int width = self->bounds.width;
       int height = self->bounds.height;
-      char *text = grub_asprintf (self->template,
-                                 self->value > 0 ? self->value : -self->value);
+      char *text = grub_malloc (grub_strlen (self->template) + 10);
       if (!text)
        {
          grub_print_error ();
          grub_errno = GRUB_ERR_NONE;
          return;
        }
+      grub_sprintf (text, self->template,
+                   self->value > 0 ? self->value : -self->value);
       /* Center the text. */
       int text_width = grub_font_get_string_width (font, text);
       int x = (width - text_width) / 2;