Update copyright year to 2017.
[paraslash.git] / afh.c
diff --git a/afh.c b/afh.c
index 195b378..36c432e 100644 (file)
--- a/afh.c
+++ b/afh.c
 #include "version.h"
 #include "ggo.h"
 
+/** Array of error strings. */
+DEFINE_PARA_ERRLIST;
+
 static struct afh_args_info conf;
-INIT_AFH_ERRLISTS;
 
 static int loglevel;
 INIT_STDERR_LOGGING(loglevel)
@@ -169,7 +171,7 @@ __noreturn static void print_help_and_die(void)
  */
 int main(int argc, char **argv)
 {
-       int i, ret, audio_format_num, fd;
+       int i, ret = 0, audio_format_num, fd;
        void *audio_file_data;
        size_t audio_file_size;
        struct afh_info afhi;
@@ -177,12 +179,9 @@ int main(int argc, char **argv)
        afh_cmdline_parser(argc, argv, &conf);
        loglevel = get_loglevel_by_name(conf.loglevel_arg);
        version_handle_flag("afh", conf.version_given);
-       if (conf.help_given || conf.detailed_help_given)
+       if (conf.help_given || conf.detailed_help_given || conf.inputs_num == 0)
                print_help_and_die();
        afh_init();
-       ret = -E_AFH_SYNTAX;
-       if (conf.inputs_num == 0)
-               goto out;
        for (i = 0; i < conf.inputs_num; i++) {
                int ret2;
                ret = mmap_full_file(conf.inputs[i], O_RDONLY, &audio_file_data,