diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2015-11-10 11:37:01 -0800 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-11-10 11:37:01 -0800 |
commit | e97835ad43f5c68e8cb29599246cae0f4461d663 (patch) | |
tree | 7971ff7a989196455d117d3c7c2a5b03a7a203d1 /util/options.hh | |
parent | d5f0d7c9fb14255388ab616f56e178cb7ca10ec2 (diff) |
[util] Fix crash when --output-file is specified but not --output-format
Diffstat (limited to 'util/options.hh')
-rw-r--r-- | util/options.hh | 3 |
1 files changed, 3 insertions, 0 deletions
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, "-")) |