sort-badblocks: Another handy testing utility.
[dvdrip] / dvd-sector-copy.c
index 4d44122..86540e0 100644 (file)
@@ -663,6 +663,7 @@ static ssize_t recovery_read(struct recoverybuf *r,
 
   n = r->pos + r->end - pos;
   if (!n && want) n = -1;
+  else if (n > want) n = want;
 
 end:
 #ifdef DEBUG