Signed-off-by: Karel Zak <kzak@redhat.com>
pr->fd = fd;
pr->off = off;
pr->size = 0;
+ pr->idx = 0;
if (size)
pr->size = size;
DBG(DEBUG_LOWPROBE, printf("ready for low-probing, offset=%zd, size=%zd\n",
pr->off, pr->size));
- pr->idx = 0;
return 0;
}
if (pr->idx)
i = pr->idx + 1;
+ if (i < 0 && i >= ARRAY_SIZE(idinfos))
+ return -1;
+
DBG(DEBUG_LOWPROBE, printf("--> starting probing loop\n"));
for ( ; i < ARRAY_SIZE(idinfos); i++) {