Wrong Answer in LABYR1 - Labyrinth

[LABYR1 - Labyrinth][1] is a simple dfs based question. But I am getting the wrong answer. I don’t know why?
Is there anything corner testcases which i am missing? Here is my


[2]. 


  [1]: http://www.spoj.com/problems/LABYR1/
  [2]: https://ideone.com/F5ONbz

Any help??