Skip to content

Commit 014a411

Browse files
tectonic: fix warnings due to comparison of signed/unsigned values
-Wsign-compare
1 parent ed6f5d5 commit 014a411

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tectonic/XeTeXFontInst.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,8 @@ XeTeXFontInst::initialize(const char* pathname, int index, int &status)
335335

336336
size_t sz = ttstub_input_get_size (handle);
337337
FT_Byte *data = (FT_Byte *) xmalloc (sz);
338-
339-
if (ttstub_input_read (handle, data, sz) != sz)
338+
size_t r = ttstub_input_read (handle, data, sz);
339+
if (r < 0 || (size_t) r != sz)
340340
_tt_abort("failed to read font file");
341341
ttstub_input_close(handle);
342342

@@ -363,10 +363,10 @@ XeTeXFontInst::initialize(const char* pathname, int index, int &status)
363363
free (afm);
364364

365365
if (afm_handle != NULL) {
366-
size_t sz = ttstub_input_get_size (afm_handle);
367-
FT_Byte *data = (FT_Byte *) xmalloc (sz);
368-
369-
if (ttstub_input_read (afm_handle, data, sz) != sz)
366+
sz = ttstub_input_get_size (afm_handle);
367+
data = (FT_Byte *) xmalloc (sz);
368+
r = ttstub_input_read (afm_handle, data, sz);
369+
if (r < 0 || (size_t) r != sz)
370370
_tt_abort("failed to read AFM file");
371371
ttstub_input_close(afm_handle);
372372

0 commit comments

Comments
 (0)