summaryrefslogtreecommitdiff
path: root/usr.bin/grep
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-12-14 20:02:08 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-12-14 20:02:08 +0000
commit6274873c26f9c52e2e5158e0210b2542e9fed89f (patch)
treee56c08d493b487293b1a837fe7302b77233873e5 /usr.bin/grep
parenta0eb48f7dcc28b2d469f7d6ebb05cb488b1e6219 (diff)
Use long long rather than off_t for line_no to ensure that it's always
64 bits. ok kettenis@
Diffstat (limited to 'usr.bin/grep')
-rw-r--r--usr.bin/grep/grep.h4
-rw-r--r--usr.bin/grep/util.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/grep/grep.h b/usr.bin/grep/grep.h
index 71379a8ca8b..21b1cab10f8 100644
--- a/usr.bin/grep/grep.h
+++ b/usr.bin/grep/grep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.h,v 1.23 2015/12/07 18:50:06 mmcc Exp $ */
+/* $OpenBSD: grep.h,v 1.24 2015/12/14 20:02:07 mmcc Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -43,7 +43,7 @@
typedef struct {
size_t len;
- off_t line_no;
+ long long line_no;
off_t off;
char *file;
char *dat;
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index d5bbed7df1e..dbad698b71f 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.51 2015/12/07 18:50:06 mmcc Exp $ */
+/* $OpenBSD: util.c,v 1.52 2015/12/14 20:02:07 mmcc Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -623,7 +623,7 @@ printline(str_t *line, int sep, regmatch_t *pmatch)
if (nflag) {
if (n)
putchar(sep);
- printf("%lld", (long long)line->line_no);
+ printf("%lld", line->line_no);
++n;
}
if (bflag) {