]> diplodocus.org Git - nmh/commitdiff
leave_getfld(): Don't follow fseeko(SEEK_SET) with ftello().
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 9 Aug 2017 16:03:24 +0000 (17:03 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 9 Aug 2017 16:03:24 +0000 (17:03 +0100)
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.

sbr/m_getfld.c

index 08d9eb0..48551ae 100644 (file)
@@ -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;
     }
 }