=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/printf/printf.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/printf/printf.c 2016/07/27 01:52:03 1.25 --- src/usr.bin/printf/printf.c 2016/11/18 15:53:16 1.26 *************** *** 1,4 **** ! /* $OpenBSD: printf.c,v 1.25 2016/07/27 01:52:03 tedu Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: printf.c,v 1.26 2016/11/18 15:53:16 schwarze Exp $ */ /* * Copyright (c) 1989 The Regents of the University of California. *************** *** 30,43 **** */ #include #include #include - #include #include ! #include ! #include ! #include ! #include static int print_escape_str(const char *); static int print_escape(const char *); --- 30,42 ---- */ #include + #include + #include + #include #include #include #include ! #include static int print_escape_str(const char *); static int print_escape(const char *); *************** *** 50,56 **** static char *getstr(void); static char *mklong(const char *, int); static void check_conversion(const char *, const char *); ! static void usage(void); static int rval; static char **gargv; --- 49,55 ---- static char *getstr(void); static char *mklong(const char *, int); static void check_conversion(const char *, const char *); ! static void __dead usage(void); static int rval; static char **gargv; *************** *** 80,87 **** char convch, nextch; char *format; - setlocale (LC_ALL, ""); - if (pledge("stdio", NULL) == -1) err(1, "pledge"); --- 79,84 ---- *************** *** 91,100 **** argv++; } ! if (argc < 2) { usage(); - return (1); - } format = *++argv; gargv = ++argv; --- 88,95 ---- argv++; } ! if (argc < 2) usage(); format = *++argv; gargv = ++argv; *************** *** 498,505 **** } } ! static void usage(void) { (void)fprintf(stderr, "usage: printf format [argument ...]\n"); } --- 493,501 ---- } } ! static void __dead usage(void) { (void)fprintf(stderr, "usage: printf format [argument ...]\n"); + exit(1); }