+2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * term/ieee1275/ofconsole.c (grub_ofconsole_setcolorstate): Allocate on
+ stack since heap may be unavailable at that point.
+ (grub_ofconsole_gotoxy): Likewise.
+
2010-01-22 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Check for _restgpr_14_x.
static void
grub_ofconsole_setcolorstate (grub_term_color_state state)
{
- char *setcol;
+ char setcol[256];
int fg;
int bg;
return;
}
- setcol = grub_xasprintf ("\e[3%dm\e[4%dm", fg, bg);
- if (setcol)
- grub_ofconsole_writeesc (setcol);
- grub_free (setcol);
+ grub_snprintf (setcol, sizeof (setcol), "\e[3%dm\e[4%dm", fg, bg);
+ grub_ofconsole_writeesc (setcol);
}
static void
{
if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI))
{
- char *s;
+ char s[256];
grub_curr_x = x;
grub_curr_y = y;
- s = grub_xasprintf ("\e[%d;%dH", y + 1, x + 1);
- if (s)
- grub_ofconsole_writeesc (s);
- grub_free (s);
+ grub_snprintf (s, sizeof (s), "\e[%d;%dH", y + 1, x + 1);
+ grub_ofconsole_writeesc (s);
}
else
{