The magnetic fields of the late-type stars