mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-20 22:48:22 +00:00
Fallback to dumb printf if malloc failes
This commit is contained in:
1 parent
d1dce5d356
commit
dcc953eecb
1 file changed
+28
@@ -751,6 +751,34 @@ grub_xputs_normal (const char *str)
|
|||||||
if (!unicode_str)
|
if (!unicode_str)
|
||||||
{
|
{
|
||||||
grub_errno = GRUB_ERR_NONE;
|
grub_errno = GRUB_ERR_NONE;
|
||||||
|
for (; *str; str++)
|
||||||
|
{
|
||||||
|
grub_term_output_t term;
|
||||||
|
grub_uint32_t code = *str;
|
||||||
|
if (code > 0x7f)
|
||||||
|
code = '?';
|
||||||
|
|
||||||
|
FOR_ACTIVE_TERM_OUTPUTS(term)
|
||||||
|
{
|
||||||
|
struct grub_unicode_glyph c =
|
||||||
|
{
|
||||||
|
.base = code,
|
||||||
|
.variant = 0,
|
||||||
|
.attributes = 0,
|
||||||
|
.ncomb = 0,
|
||||||
|
.combining = 0,
|
||||||
|
.estimated_width = 1
|
||||||
|
};
|
||||||
|
|
||||||
|
(term->putchar) (term, &c);
|
||||||
|
if (code == '\n')
|
||||||
|
{
|
||||||
|
c.base = '\r';
|
||||||
|
(term->putchar) (term, &c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user