Instead of using an ugly goto statement, we can add a proper usage function.
This also adds the undocumented '-n' option to the output string.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
int mbufsize;
char *mbuf;
+static void __attribute__((__noreturn__)) usage()
+{
+ errx(EXIT_FAILURE, _("usage: %s [-n] [file]\n"),
+ program_invocation_short_name);
+}
+
int
main(int argc, char **argv) {
extern int optind;
break;
case '?':
default:
-usage:
- fprintf(stderr, _("usage: %s [file]\n"),
- program_invocation_short_name);
- exit(EXIT_FAILURE);
+ usage();
}
}
argc -= optind;
argv += optind;
if (argc > 1)
- goto usage;
+ usage();
makemsg(*argv);