As far as I know you can't just "extend" an array by writing past its last item!
You are essentially writing into memory that doesn't belong to your array, possibly overwriting other parts of your programs memory.
Apparently there is no boundary checking, because its old C array style or something.
http://stackoverflow.com/questions/1239938/c-accesses-an-array-out-of-bounds-gives-no-error-why
Just because it doesn't give you an error doesn't mean it's working correctly.
Also line 35 and onwards will never execute because your function already returns on line 31, IF it would even go that far, which it won't, because it will always return on line 24, because of what MiiNiPaa mentioned.
Inside of your function the size of the array is not known, its essentially just a variable that holds a number which represents the adress in memory where the FIRST element of your array resides (a so called pointer, in this case to an int, so an int*), and sizeof(arr) gives you only the size of that pointer, which should always be 4 bytes if your program runs in 32bit mode, or 8 if 64 bit mode.
Thats why you always have to pass in the size beforehand, because inside of the function its not possible to determine the size anymore.