reverse sentence segment fault