diff --git a/src/next.c b/src/next.c index e5f03bba..2a5efd0e 100644 --- a/src/next.c +++ b/src/next.c @@ -45,9 +45,9 @@ struct search_location typedef struct search_location search_location_t; static inline uint64_t CHS_to_offset(const unsigned int C, const int H, const int S,const disk_t *disk_car); -#define SEARCH_LOCATION_MAX 128 +#define SEARCH_LOCATION_MAX 256 static unsigned int search_location_nbr=0; -static search_location_t search_location_info[SEARCH_LOCATION_MAX]; +static search_location_t search_location_info[SEARCH_LOCATION_MAX+1]; static inline uint64_t CHS_to_offset(const unsigned int C, const int H, const int S,const disk_t *disk_car) { @@ -59,7 +59,8 @@ static void update_location(void) unsigned int i; if(search_location_info[search_location_nbr].inc==0) { - search_location_nbr++; + if(search_location_nbr < SEARCH_LOCATION_MAX) + search_location_nbr++; return; } for(i=0; i