* util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable.

This commit is contained in:
Trevor Woerner 2014-06-21 20:26:47 +02:00 committed by Vladimir Serbinenko
parent 2c2c5c720d
commit 87de66d9d8
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2014-06-21 Trevor Woerner <trevor.woerner@linaro.org>
* util/grub-gen-asciih.c (add_glyph): Fix uninitialised variable.
2014-06-21 Vladimir Serbinenko <phcoder@gmail.com> 2014-06-21 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/verify.c (grub_pubkey_open): Trust procfs. * grub-core/commands/verify.c (grub_pubkey_open): Trust procfs.

View file

@ -81,14 +81,14 @@ add_glyph (FT_UInt glyph_idx, FT_Face face,
err = FT_Load_Glyph (face, glyph_idx, flag); err = FT_Load_Glyph (face, glyph_idx, flag);
if (err) if (err)
{ {
printf ("Freetype Error %d loading glyph 0x%x for U+0x%x", fprintf (stderr, "Freetype Error %d loading glyph 0x%x for U+0x%x",
err, glyph_idx, char_code); err, glyph_idx, char_code);
if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs)) if (err > 0 && err < (signed) ARRAY_SIZE (ft_errmsgs))
printf (": %s\n", ft_errmsgs[err]); fprintf (stderr, ": %s\n", ft_errmsgs[err]);
else else
printf ("\n"); fprintf (stderr, "\n");
return; exit (1);
} }
glyph = face->glyph; glyph = face->glyph;
@ -128,7 +128,6 @@ add_glyph (FT_UInt glyph_idx, FT_Face face,
static void static void
write_font_ascii_bitmap (FILE *file, FT_Face face) write_font_ascii_bitmap (FILE *file, FT_Face face)
{ {
struct grub_glyph_info glyph;
int char_code; int char_code;
fprintf (file, "/* THIS CHUNK OF BYTES IS AUTOMATICALLY GENERATED */\n"); fprintf (file, "/* THIS CHUNK OF BYTES IS AUTOMATICALLY GENERATED */\n");
@ -138,10 +137,14 @@ write_font_ascii_bitmap (FILE *file, FT_Face face)
for (char_code = 0; char_code <= 0x7f; char_code++) for (char_code = 0; char_code <= 0x7f; char_code++)
{ {
FT_UInt glyph_idx; FT_UInt glyph_idx;
struct grub_glyph_info glyph;
glyph_idx = FT_Get_Char_Index (face, char_code); glyph_idx = FT_Get_Char_Index (face, char_code);
if (!glyph_idx) if (!glyph_idx)
return; return;
memset (&glyph, 0, sizeof(glyph));
add_glyph (glyph_idx, face, char_code, &glyph); add_glyph (glyph_idx, face, char_code, &glyph);
if (glyph.width == 8 && glyph.height == 16 if (glyph.width == 8 && glyph.height == 16