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
5b9926665b
commit
df6c6c6c15
@ -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…
x
Reference in New Issue
Block a user