aboutsummaryrefslogtreecommitdiff
path: root/time/zdump.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-03-09 10:00:12 +0000
committerRoland McGrath <roland@gnu.org>1995-03-09 10:00:12 +0000
commit6c2f050742cfb5b3ff6ee96b106409f541eb53bc (patch)
treef7296a81b8d5524dddfa0aa1cc24342d8ef9ac24 /time/zdump.c
parent286351153566acc7dcc82834d90e0b8d87dff8be (diff)
downloadglibc-6c2f050742cfb5b3ff6ee96b106409f541eb53bc.zip
glibc-6c2f050742cfb5b3ff6ee96b106409f541eb53bc.tar.gz
glibc-6c2f050742cfb5b3ff6ee96b106409f541eb53bc.tar.bz2
Wed Mar 8 13:38:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* posix/glob/configure.bat: Fixes from DJ. * time/backward, time/europe, time/northamerica, time/pacificnew, time/zdump.c, time/zic.c, time/tzfile.h, time/private.h, time/ialloc.c: Code and data updated from ADO's 95b. * time/emkdir.c: File removed. * time/Makefile (distribute, extra-objs, zic): Omit it. * time/localtime.c: Deansideclized. Never #define __tzname et al to non-__ names. * locale/lc-ctype.c (__ctype_tolower, __ctype_toupper): Use int * instead of short int *. * ctype/ctype-info.c: Likewise. * ctype/ctype.h: Likewise. * locale/langinfo.h (_NL_CTYPE_CLASS): Use this (just one) instead of EB and EL versions.
Diffstat (limited to 'time/zdump.c')
-rw-r--r--time/zdump.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/time/zdump.c b/time/zdump.c
index d35df33..3288211 100644
--- a/time/zdump.c
+++ b/time/zdump.c
@@ -1,6 +1,6 @@
#ifndef lint
#ifndef NOID
-static char elsieid[] = "@(#)zdump.c 7.12";
+static char elsieid[] = "@(#)zdump.c 7.20";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -10,10 +10,11 @@ static char elsieid[] = "@(#)zdump.c 7.12";
** You can use this code to help in verifying other implementations.
*/
-#include "stdio.h" /* for stdout, stderr */
+#include "stdio.h" /* for stdout, stderr, perror */
#include "string.h" /* for strcpy */
#include "sys/types.h" /* for time_t */
#include "time.h" /* for struct tm */
+#include "stdlib.h" /* for exit, malloc, atoi */
#ifndef MAX_STRING_LENGTH
#define MAX_STRING_LENGTH 1024
@@ -71,9 +72,11 @@ static char elsieid[] = "@(#)zdump.c 7.12";
#ifdef lint
#define GNUC_or_lint
#endif /* defined lint */
+#ifndef lint
#ifdef __GNUC__
#define GNUC_or_lint
#endif /* defined __GNUC__ */
+#endif /* !defined lint */
#endif /* !defined GNUC_or_lint */
#ifndef INITIALIZE
@@ -92,11 +95,6 @@ extern int optind;
extern time_t time();
extern char * tzname[2];
-#ifdef USG
-extern void exit();
-extern void perror();
-#endif /* defined USG */
-
static char * abbr();
static long delta();
static time_t hunt();
@@ -109,16 +107,19 @@ main(argc, argv)
int argc;
char * argv[];
{
- register int i, c;
+ register int i;
+ register int c;
register int vflag;
register char * cutoff;
register int cutyear;
register long cuttime;
char ** fakeenv;
time_t now;
- time_t t, newt;
+ time_t t;
+ time_t newt;
time_t hibit;
- struct tm tm, newtm;
+ struct tm tm;
+ struct tm newtm;
INITIALIZE(cuttime);
progname = argv[0];
@@ -152,15 +153,18 @@ char * argv[];
for (hibit = 1; (hibit << 1) != 0; hibit <<= 1)
continue;
{
- register int from, to;
+ register int from;
+ register int to;
for (i = 0; environ[i] != NULL; ++i)
continue;
- fakeenv = (char **) malloc((i + 2) * sizeof *fakeenv);
+ fakeenv = (char **) malloc((size_t) ((i + 2) *
+ sizeof *fakeenv));
if (fakeenv == NULL ||
- (fakeenv[0] = (char *) malloc(longest + 4)) == NULL) {
- (void) perror(progname);
- (void) exit(EXIT_FAILURE);
+ (fakeenv[0] = (char *) malloc((size_t) (longest +
+ 4))) == NULL) {
+ (void) perror(progname);
+ (void) exit(EXIT_FAILURE);
}
to = 0;
(void) strcpy(fakeenv[to++], "TZ=");