Potential-energy curves for O2+, N2+, and CO+