From 01944bbfc202d8a168d130fd817467ca9fd323b8 Mon Sep 17 00:00:00 2001 From: tjr Date: Mon, 22 Mar 2004 11:15:03 +0000 Subject: Use fseeko() to properly support large files. --- usr.bin/csplit/csplit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/csplit/csplit.c') diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index 5ca97f5..2dff81f 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -326,12 +326,12 @@ toomuch(FILE *ofp, long n) if (ftello(ofp) < (off_t)sizeof(buf)) rewind(ofp); else - fseek(ofp, -(long)sizeof(buf), SEEK_CUR); + fseeko(ofp, -(off_t)sizeof(buf), SEEK_CUR); if (ferror(ofp)) errx(1, "%s: can't seek", currfile); if ((nread = fread(buf, 1, sizeof(buf), ofp)) == 0) errx(1, "can't read overflowed output"); - if (fseek(ofp, -(long)nread, SEEK_CUR) != 0) + if (fseeko(ofp, -(off_t)nread, SEEK_CUR) != 0) err(1, "%s", currfile); for (i = 1; i <= nread; i++) if (buf[nread - i] == '\n' && n-- == 0) @@ -339,7 +339,7 @@ toomuch(FILE *ofp, long n) if (ftello(ofp) == 0) break; } while (n > 0); - if (fseek(ofp, nread - i + 1, SEEK_CUR) != 0) + if (fseeko(ofp, nread - i + 1, SEEK_CUR) != 0) err(1, "%s", currfile); /* -- cgit v1.1