From e97835ad43f5c68e8cb29599246cae0f4461d663 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 Nov 2015 11:37:01 -0800 Subject: [PATCH] [util] Fix crash when --output-file is specified but not --output-format --- util/options.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/options.hh b/util/options.hh index 9dc4433f..1ef4131e 100644 --- a/util/options.hh +++ b/util/options.hh @@ -401,7 +401,10 @@ struct output_options_t : option_group_t if (output_file && !output_format) { output_format = strrchr (output_file, '.'); if (output_format) + { output_format++; /* skip the dot */ + output_format = strdup (output_format); + } } if (output_file && 0 == strcmp (output_file, "-")) -- GitLab