Fix that skipping fails if target is 2nd frame
[alexxy/gromacs.git] / src / gmxlib / libxdrf.c
index d3209280241d9c746c01700b42f4c1aca5de0869..dd56225b548d38e697a25c9ee0f5b68bd029730f 100644 (file)
@@ -1466,7 +1466,7 @@ int xdr_xtc_seek_time(real time, FILE *fp, XDR *xdrs, int natoms, gmx_bool bSeek
 
     if (bSeekForwardOnly)
     {
-        low = gmx_ftell(fp);
+        low = gmx_ftell(fp)-header_size;
     }
     if (gmx_fseek(fp, 0, SEEK_END))
     {