--- a/lib/lib.c	2014-02-25 11:04:43.000000000 +0530
+++ b/lib/lib.c	2014-02-26 18:02:08.628632550 +0530
@@ -109,7 +109,7 @@
 
     or = readall(fd, libbuf, try);
     if (or < 0) perror_exit("lskip to %lld", (long long)offset);
-    else offset -= try;
+    else offset -= or;
     if (or < try) break;
   }
 
