[util] Minor

This commit is contained in:
Behdad Esfahbod 2018-02-08 16:27:57 -06:00
parent 5021ba2a21
commit 194140d3f3
2 changed files with 9 additions and 3 deletions

View File

@ -73,7 +73,7 @@ struct subset_consumer_t
fprintf(stderr, "Unable to open output file\n"); fprintf(stderr, "Unable to open output file\n");
return false; return false;
} }
size_t bytes_written = fwrite(data, 1, data_length, fp_out); ssize_t bytes_written = fwrite(data, 1, data_length, fp_out);
if (bytes_written == -1) { if (bytes_written == -1) {
fprintf(stderr, "Unable to write output file\n"); fprintf(stderr, "Unable to write output file\n");

View File

@ -240,19 +240,25 @@ struct shape_options_t : option_group_t
{ {
if (error) if (error)
*error = "all shapers failed."; *error = "all shapers failed.";
return false; goto fail;
} }
if (normalize_glyphs) if (normalize_glyphs)
hb_buffer_normalize_glyphs (buffer); hb_buffer_normalize_glyphs (buffer);
if (verify && !verify_buffer (buffer, text_buffer, font, error)) if (verify && !verify_buffer (buffer, text_buffer, font, error))
return false; goto fail;
if (text_buffer) if (text_buffer)
hb_buffer_destroy (text_buffer); hb_buffer_destroy (text_buffer);
return true; return true;
fail:
if (text_buffer)
hb_buffer_destroy (text_buffer);
return false;
} }
bool verify_buffer (hb_buffer_t *buffer, bool verify_buffer (hb_buffer_t *buffer,