diff --git a/binsearch.c b/binsearch.c index b00f2db..c7f210e 100644 --- a/binsearch.c +++ b/binsearch.c @@ -29,7 +29,7 @@ int binsearchr(int array[], int from, int to, int target) { if (array[m] == target) { return m; - } if (array[m] > target) { + } else if (array[m] > target) { return binsearchr(array, from, m-1, target); } else { /* array[m] < target */