summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-03-22 11:15:03 +0000
committertjr <tjr@FreeBSD.org>2004-03-22 11:15:03 +0000
commit01944bbfc202d8a168d130fd817467ca9fd323b8 (patch)
tree7df0086503962ae447dc9c3ac76f805010490bf4
parente230d44ca74ec5f520bfa597681660073310ff99 (diff)
downloadFreeBSD-src-01944bbfc202d8a168d130fd817467ca9fd323b8.zip
FreeBSD-src-01944bbfc202d8a168d130fd817467ca9fd323b8.tar.gz
Use fseeko() to properly support large files.
-rw-r--r--usr.bin/csplit/csplit.c6
1 files changed, 3 insertions, 3 deletions
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);
/*
OpenPOWER on IntegriCloud