diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-10-19 18:20:27 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-10-19 18:20:27 +0000 |
commit | 7aba8e9b446901982da24c12cf28023db2701b30 (patch) | |
tree | e7e10c0cd71cbab7399325a0144aaaf3f1eb0807 /bin/date | |
parent | 9a23494aa0d3aabacfd327dd2ccd3f4e5a015c96 (diff) |
Delete useless setlocale(3) in src/bin/.
Minor cleanup while here: return from main, static void __dead usage, etc.
Based on a patch from Jan Stary <hans at stare dot cz>.
Feedback and OK tb@, OK millert@.
Diffstat (limited to 'bin/date')
-rw-r--r-- | bin/date/date.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index 96fc97e2509..65d89e0d404 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -1,4 +1,4 @@ -/* $OpenBSD: date.c,v 1.49 2015/10/09 01:37:06 deraadt Exp $ */ +/* $OpenBSD: date.c,v 1.50 2016/10/19 18:20:25 schwarze Exp $ */ /* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */ /* @@ -39,7 +39,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <locale.h> #include <syslog.h> #include <time.h> #include <unistd.h> @@ -53,7 +52,7 @@ int slidetime; static void setthetime(char *); static void badformat(void); -static void usage(void); +static void __dead usage(void); int main(int argc, char *argv[]) @@ -64,8 +63,6 @@ main(int argc, char *argv[]) int ch, rflag; char *format, buf[1024], *outzone = NULL; - setlocale(LC_ALL, ""); - tz.tz_dsttime = tz.tz_minuteswest = 0; rflag = 0; while ((ch = getopt(argc, argv, "ad:jr:ut:z:")) != -1) @@ -146,7 +143,7 @@ main(int argc, char *argv[]) errx(1, "conversion error"); (void)strftime(buf, sizeof(buf), format, tp); (void)printf("%s\n", buf); - exit(0); + return 0; } #define ATOI2(ar) ((ar) += 2, ((ar)[-2] - '0') * 10 + ((ar)[-1] - '0')) @@ -262,7 +259,7 @@ badformat(void) usage(); } -static void +static void __dead usage(void) { (void)fprintf(stderr, |