summaryrefslogtreecommitdiffstats
path: root/usr.bin/pr
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-06-29 17:06:00 +0000
committerbde <bde@FreeBSD.org>1998-06-29 17:06:00 +0000
commit122886a1e045b6711c6a11c9d90d10faee896958 (patch)
treeace78682a8f56db8f3a9f80b67be82ddd614b54c /usr.bin/pr
parent0b0c5d1c4e51492acceb52c065db2dfd454a6494 (diff)
downloadFreeBSD-src-122886a1e045b6711c6a11c9d90d10faee896958.zip
FreeBSD-src-122886a1e045b6711c6a11c9d90d10faee896958.tar.gz
Don't assume that time_t is long.
Diffstat (limited to 'usr.bin/pr')
-rw-r--r--usr.bin/pr/pr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c
index ed729d8..c4fac42 100644
--- a/usr.bin/pr/pr.c
+++ b/usr.bin/pr/pr.c
@@ -1255,6 +1255,7 @@ nxtfile(argc, argv, fname, buf, dt)
{
FILE *inf = NULL;
struct timeval tv;
+ time_t tv_sec;
struct timezone tz;
struct tm *timeptr = NULL;
struct stat statbuf;
@@ -1282,7 +1283,8 @@ nxtfile(argc, argv, fname, buf, dt)
eoptind = argc - 1;
return(NULL);
}
- timeptr = localtime(&(tv.tv_sec));
+ tv_sec = tv.tv_sec;
+ timeptr = localtime(&tv_sec);
}
for (; eoptind < argc; ++eoptind) {
if (strcmp(argv[eoptind], "-") == 0) {
@@ -1305,7 +1307,8 @@ nxtfile(argc, argv, fname, buf, dt)
strerror(errno));
return(NULL);
}
- timeptr = localtime(&(tv.tv_sec));
+ tv_sec = tv.tv_sec;
+ timeptr = localtime(&tv_sec);
} else {
/*
* normal file processing
@@ -1336,7 +1339,8 @@ nxtfile(argc, argv, fname, buf, dt)
strerror(errno));
return(NULL);
}
- timeptr = localtime(&(tv.tv_sec));
+ tv_sec = tv.tv_sec;
+ timeptr = localtime(&tv_sec);
} else {
if (fstat(fileno(inf), &statbuf) < 0) {
++errcnt;
OpenPOWER on IntegriCloud