diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-01-25 21:20:12 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-01-25 21:20:12 -0800 |
commit | f57429096f6cd9f96a749e72fd99b2bf1252b463 (patch) | |
tree | 0a372bdacf63bdb98769640291ba01e014626c52 /stream.c | |
parent | 1ba633898340b2abf04b3ffdb4f3790118e85677 (diff) | |
download | txr-f57429096f6cd9f96a749e72fd99b2bf1252b463.tar.gz txr-f57429096f6cd9f96a749e72fd99b2bf1252b463.tar.bz2 txr-f57429096f6cd9f96a749e72fd99b2bf1252b463.zip |
streams: use Boolean return value for stdio_fseek.
* stream.c (stdio_seek): Handle new-style Boolean return from
stdio_fseek.
* sysif.c (stdio_fseek): Return an int indication that is 1
for success, 0 for failure. There was a mistaken assumption
here that fseeko returns the file offset, and the return value
in the fseek case was mistakenly harmonized, using a wasteful
call to stdio_ftell. The only call to this function relies
only on a Boolean success/fail indication.
* sysif.h (stdio_fseek): Declaration updated.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -675,7 +675,7 @@ static val stdio_seek(val stream, val offset, enum strm_whence whence) if (offset == zero && whence == strm_cur) { return stdio_ftell(h->f); } else { - if (stdio_fseek(h->f, offset, whence) != negone) { + if (stdio_fseek(h->f, offset, whence)) { utf8_decoder_init(&h->ud); h->unget_c = nil; return t; |