From: Ralph Corderoy Date: Wed, 9 Aug 2017 16:03:24 +0000 (+0100) Subject: leave_getfld(): Don't follow fseeko(SEEK_SET) with ftello(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/df646add9dde90130753c06938e425c8f8f39c0f?ds=inline leave_getfld(): Don't follow fseeko(SEEK_SET) with ftello(). If fseeko(3) didn't error then we know the stream's position and the ftello(3) is not needed. Set last_caller_pos to total_bytes_read instead. This small change is a commit to help future bisecting. --- diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 08d9eb09..48551ae5 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -472,8 +472,8 @@ leave_getfld (m_getfld_state_t s) { if (fseeko(s->iob, s->total_bytes_read, SEEK_SET) == -1) adios("getfld's iob", "failed to set offset: %ld", s->total_bytes_read); - if ((s->last_caller_pos = ftello(s->iob)) == -1) - adios("getfld's iob", "failed to get offset after seek"); + + s->last_caller_pos = s->total_bytes_read; } }