From dac9fc1936c08659c3b62bfcfafd2e9e57bd6b99 Mon Sep 17 00:00:00 2001 From: tedu Date: Tue, 6 May 2014 15:49:45 +0000 Subject: [PATCH] enh@google reported a warning in crufty y2k code. just delete it. ok deraadt stsp --- lib/libc/time/private.h | 3 +-- lib/libc/time/strftime.c | 22 +--------------------- lib/libc/time/wcsftime.c | 22 +--------------------- 3 files changed, 3 insertions(+), 44 deletions(-) diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h index a7e09020505..b859f8edea8 100644 --- a/lib/libc/time/private.h +++ b/lib/libc/time/private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: private.h,v 1.25 2012/09/13 11:14:20 millert Exp $ */ +/* $OpenBSD: private.h,v 1.26 2014/05/06 15:49:45 tedu Exp $ */ #ifndef PRIVATE_H #define PRIVATE_H @@ -16,7 +16,6 @@ #define STD_INSPIRED 1 #define HAVE_STRERROR 1 #define HAVE_STDINT_H 1 -#define NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU 1 /* ** This header is for use ONLY with the time conversion code. diff --git a/lib/libc/time/strftime.c b/lib/libc/time/strftime.c index 3bcee1fc7dd..dbf320ebc52 100644 --- a/lib/libc/time/strftime.c +++ b/lib/libc/time/strftime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strftime.c,v 1.21 2012/09/13 11:14:20 millert Exp $ */ +/* $OpenBSD: strftime.c,v 1.22 2014/05/06 15:49:45 tedu Exp $ */ #include "private.h" /* @@ -111,10 +111,6 @@ static char * _yconv(int, int, int, int, char *, const char *); extern char * tzname[]; -#ifndef YEAR_2000_NAME -#define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS" -#endif /* !defined YEAR_2000_NAME */ - #define IN_NONE 0 #define IN_SOME 1 #define IN_THIS 2 @@ -136,22 +132,6 @@ const struct tm * const t; #endif /* defined LOCALE_HOME */ warn = IN_NONE; p = _fmt(((format == NULL) ? "%c" : format), t, s, s + maxsize, &warn); -#ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU - if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { - (void) fprintf(stderr, "\n"); - if (format == NULL) - (void) fprintf(stderr, "NULL strftime format "); - else (void) fprintf(stderr, "strftime format \"%s\" ", - format); - (void) fprintf(stderr, "yields only two digits of years in "); - if (warn == IN_SOME) - (void) fprintf(stderr, "some locales"); - else if (warn == IN_THIS) - (void) fprintf(stderr, "the current locale"); - else (void) fprintf(stderr, "all locales"); - (void) fprintf(stderr, "\n"); - } -#endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */ if (p == s + maxsize) { if (maxsize > 0) s[maxsize - 1] = '\0'; diff --git a/lib/libc/time/wcsftime.c b/lib/libc/time/wcsftime.c index 5760493a3a2..21ccac704df 100644 --- a/lib/libc/time/wcsftime.c +++ b/lib/libc/time/wcsftime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsftime.c,v 1.2 2013/01/20 20:29:02 millert Exp $ */ +/* $OpenBSD: wcsftime.c,v 1.3 2014/05/06 15:49:45 tedu Exp $ */ #include "private.h" /* @@ -110,10 +110,6 @@ static wchar_t * _yconv(int, int, int, int, wchar_t *, const wchar_t *); extern char * tzname[]; -#ifndef YEAR_2000_NAME -#define YEAR_2000_NAME "CHECK_STRFTIME_FORMATS_FOR_TWO_DIGIT_YEARS" -#endif /* !defined YEAR_2000_NAME */ - #define IN_NONE 0 #define IN_SOME 1 #define IN_THIS 2 @@ -129,22 +125,6 @@ wcsftime(wchar_t *__restrict s, size_t maxsize, tzset(); warn = IN_NONE; p = _fmt(((format == NULL) ? L"%c" : format), t, s, s + maxsize, &warn); -#ifndef NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU - if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { - (void) fprintf(stderr, "\n"); - if (format == NULL) - (void) fprintf(stderr, "NULL strftime format "); - else (void) fwprintf(stderr, "strftime format \"%ls\" ", - format); - (void) fprintf(stderr, "yields only two digits of years in "); - if (warn == IN_SOME) - (void) fprintf(stderr, "some locales"); - else if (warn == IN_THIS) - (void) fprintf(stderr, "the current locale"); - else (void) fprintf(stderr, "all locales"); - (void) fprintf(stderr, "\n"); - } -#endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */ if (p == s + maxsize) { if (maxsize > 0) s[maxsize - 1] = '\0'; -- 2.20.1