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.
This commit is contained in:
parent
dac4a67ce7
commit
7cbfe4d8da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82771
@ -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() */
|
||||
|
Loading…
Reference in New Issue
Block a user