recursive sub string length : im trying to write a recursive function that receives an array and its size and some other variables (of my choice). the function returns the length of the longest ascending substring in the array. the limitation are no loops and no calling other functions or using pointers or other libraries.

this is the code i wrote, which unfortunately isn't working and i don't understand why! 

    int max_set(int arr[], int size, int max, int index1, int index2, int 
    currentMax) {
	 int path1, path2;
	 if (index1 == size)
		 return currentMax;
	 if (index2 = size){
		 if (currentMax < max)
			 currentMax = max;
		 index1++;
		 index2 = index1 + 1;
		 max = 1;
	 }
	 if (arr[index2]> arr[index1])
		 max++;
	 path1 = max_set(arr, size, max, index1, index2 + 1, currentMax);
	 path2 = max_set(arr, size, max, index1 + 1, index2 + 1, currentMax);
	 if (path1 > path2)
		return path1;
	 else
		 return path2;
    }

thank you!