Skip to content

Commit c35961a

Browse files
arichardsonlemzwerg
authored andcommitted
* tests/issue-1063/main.c (main): Fix uninitialized variable.
I tried running `meson test` but the test just crashed and gdb reported that the face argument to `FT_Get_Char_Index` was nonsense. With this change the test prints 'Could not open file: ' as it should.
1 parent 552fc97 commit c35961a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ChangeLog

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2021-07-15 Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2+
3+
* tests/issue-1063/main.c (main): Fix uninitialized variable.
4+
5+
I tried running `meson test` but the test just crashed and gdb
6+
reported that the face argument to `FT_Get_Char_Index` was nonsense.
7+
With this change the test prints 'Could not open file: ' as it
8+
should.
9+
110
2021-07-16 Werner Lemberg <wl@gnu.org>
211

312
[smooth] Minor fixes.

tests/issue-1063/main.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ int
77
main( void )
88
{
99
FT_Library library;
10-
FT_Face face;
10+
FT_Face face = NULL;
1111

1212
/* Assumes this is run from out/ build directory though 'meson test -C out' */
1313
const char* filepath = "../tests/data/As.I.Lay.Dying.ttf";
1414

1515
FT_Init_FreeType( &library );
16-
FT_New_Face( library, filepath, 0, &face );
17-
if ( !face )
16+
if ( FT_New_Face( library, filepath, 0, &face ) != 0 )
1817
{
1918
fprintf( stderr, "Could not open file: %s\n", filepath );
2019
return 1;

0 commit comments

Comments
 (0)