summaryrefslogtreecommitdiffstats
path: root/bin/ed/buf.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-09-01 23:26:40 +0000
committerache <ache@FreeBSD.org>2001-09-01 23:26:40 +0000
commitdf6c6c6c15742570a2b9bea1c40a4060735d3ada (patch)
treed604cb8eef308fcbf5cac452634d12c27abdeddc /bin/ed/buf.c
parent5b9926665b0c98a3b66ec3dd85d750fbcd356210 (diff)
downloadFreeBSD-src-df6c6c6c15742570a2b9bea1c40a4060735d3ada.zip
FreeBSD-src-df6c6c6c15742570a2b9bea1c40a4060735d3ada.tar.gz
File positions are off_t nowdays, not long, so:
fseek -> fseeko ftell -> ftello NOTE: that fseek/ftell not works for >long offsets per POSIX: [EOVERFLOW] For fseek( ), the resulting file offset would be a value which cannot be represented correctly in an object of type long. [EOVERFLOW] For ftell ( ), the current file offset cannot be represented correctly in an object of type long.
Diffstat (limited to 'bin/ed/buf.c')
-rw-r--r--bin/ed/buf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index fb23e5a..01f722b 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -59,7 +59,7 @@ get_sbuf_line(lp)
/* out of position */
if (sfseek != lp->seek) {
sfseek = lp->seek;
- if (fseek(sfp, sfseek, SEEK_SET) < 0) {
+ if (fseeko(sfp, sfseek, SEEK_SET) < 0) {
fprintf(stderr, "%s\n", strerror(errno));
errmsg = "cannot seek temp file";
return NULL;
@@ -103,12 +103,12 @@ put_sbuf_line(cs)
len = s - cs;
/* out of position */
if (seek_write) {
- if (fseek(sfp, 0L, SEEK_END) < 0) {
+ if (fseeko(sfp, (off_t)0, SEEK_END) < 0) {
fprintf(stderr, "%s\n", strerror(errno));
errmsg = "cannot seek temp file";
return NULL;
}
- sfseek = ftell(sfp);
+ sfseek = ftello(sfp);
seek_write = 0;
}
/* assert: SPL1() */
OpenPOWER on IntegriCloud