diff options
| author | David Malone <dwmalone@FreeBSD.org> | 2005-01-10 20:19:46 +0000 |
|---|---|---|
| committer | David Malone <dwmalone@FreeBSD.org> | 2005-01-10 20:19:46 +0000 |
| commit | d0990ea900d0caa58b17d88ed48239d06a8b8b61 (patch) | |
| tree | 98f3f072882c98d0c30f49d193e6a430dfa8105e /usr.bin/tail | |
| parent | a2fb00d93f6c070e1086035a8b4ea6d39e763a2b (diff) | |
Notes
Diffstat (limited to 'usr.bin/tail')
| -rw-r--r-- | usr.bin/tail/misc.c | 4 | ||||
| -rw-r--r-- | usr.bin/tail/reverse.c | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/tail/misc.c b/usr.bin/tail/misc.c index c2f18836775f..584e3d103eab 100644 --- a/usr.bin/tail/misc.c +++ b/usr.bin/tail/misc.c @@ -79,7 +79,7 @@ mapprint(struct mapinfo *mip, off_t startoff, off_t len) while (len > 0) { if (startoff < mip->mapoff || startoff >= mip->mapoff + - mip->maplen) { + (off_t)mip->maplen) { if (maparound(mip, startoff) != 0) return (1); } @@ -107,7 +107,7 @@ maparound(struct mapinfo *mip, off_t offset) mip->mapoff = offset & ~((off_t)TAILMAPLEN - 1); mip->maplen = TAILMAPLEN; - if (mip->maplen > mip->maxoff - mip->mapoff) + if ((off_t)mip->maplen > mip->maxoff - mip->mapoff) mip->maplen = mip->maxoff - mip->mapoff; if (mip->maplen <= 0) abort(); diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 64a8313f112b..ea2ed70df003 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <err.h> #include <errno.h> #include <limits.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -128,7 +129,8 @@ r_reg(FILE *fp, enum STYLE style, off_t off, struct stat *sbp) curoff = size - 2; lineend = size; while (curoff >= 0) { - if (curoff < map.mapoff || curoff >= map.mapoff + map.maplen) { + if (curoff < map.mapoff || + curoff >= map.mapoff + (off_t)map.maplen) { if (maparound(&map, curoff) != 0) { ierr(); return; @@ -245,7 +247,7 @@ r_buf(FILE *fp) } if (enomem) { - warnx("warning: %qd bytes discarded", enomem); + warnx("warning: %jd bytes discarded", (intmax_t)enomem); rval = 1; } |
