Ionic and bonding defects in hydrogen-bonded chains