Mark Kettenis wrote: > > Date: Sat, 12 Dec 2015 16:26:30 -0500 > > From: Michael McConville <mm...@mykolab.com> > > > > Mark Kettenis wrote: > > > It really is confusing to use off_t for something that's not a byte > > > offset. If integer overflow really is an issue you care about, use > > > "long long". > > > > ok for the below diff to update my grep change? > > Fine with me.
Thanks. And how about this for csplit? Index: csplit.c =================================================================== RCS file: /cvs/src/usr.bin/csplit/csplit.c,v retrieving revision 1.8 diff -u -p -r1.8 csplit.c --- csplit.c 11 Oct 2015 17:43:03 -0000 1.8 +++ csplit.c 14 Dec 2015 20:03:43 -0000 @@ -80,7 +80,7 @@ int kflag; /* Keep output if error oc /* * Other miscellaneous globals (XXX too many) */ -long lineno; /* Current line number in input file */ +long long lineno; /* Current line number in input file */ long reps; /* Number of repetitions for this pattern */ long nfiles; /* Number of files output so far */ long maxfiles; /* Maximum number of files we can create */ @@ -439,7 +439,7 @@ do_rexp(const char *expr) void do_lineno(const char *expr) { - long lastline, tgtline; + long long lastline, tgtline; char *ep, *p; FILE *ofp; @@ -455,7 +455,7 @@ do_lineno(const char *expr) ofp = newfile(); while (lineno + 1 != lastline) { if ((p = get_line()) == NULL) - errx(1, "%ld: out of range", lastline); + errx(1, "%lld: out of range", lastline); if (fputs(p, ofp) != 0) break; }