From 194140d3f352b53b95757cccb7fff50425747cd6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 8 Feb 2018 16:27:57 -0600 Subject: [PATCH] [util] Minor --- util/hb-subset.cc | 2 +- util/options.hh | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/util/hb-subset.cc b/util/hb-subset.cc index fb6d36357..37ec7b51d 100644 --- a/util/hb-subset.cc +++ b/util/hb-subset.cc @@ -73,7 +73,7 @@ struct subset_consumer_t fprintf(stderr, "Unable to open output file\n"); 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) { fprintf(stderr, "Unable to write output file\n"); diff --git a/util/options.hh b/util/options.hh index 155f70798..411165bf2 100644 --- a/util/options.hh +++ b/util/options.hh @@ -240,19 +240,25 @@ struct shape_options_t : option_group_t { if (error) *error = "all shapers failed."; - return false; + goto fail; } if (normalize_glyphs) hb_buffer_normalize_glyphs (buffer); if (verify && !verify_buffer (buffer, text_buffer, font, error)) - return false; + goto fail; if (text_buffer) hb_buffer_destroy (text_buffer); return true; + + fail: + if (text_buffer) + hb_buffer_destroy (text_buffer); + + return false; } bool verify_buffer (hb_buffer_t *buffer,