Merge 2 sorted array with O(1) space

Please check what is wrong with my code and what would be its time complexity?
Link to code->https://ide.codingblocks.com/s/620366