The linear resistive magnetohydrodynamical stability of the n = 1 internal kink mode in tokamaks is studied numerically. The stabilizing influence of small aspect ratio [Holmes et al., Phys. Fluids B 1, 788 (1989)] is confirmed, but it is found that shaping of the cross section influences the internal kink mode significantly. For finite pressure and small resistivity, curvature effects at the q= 1 surface make the stability sensitively dependent on shape, and ellipticity is destabilizing. Only a very restricted set of finite pressure equilibria is completely stable for q0 < 1. A typical result is that the resistive kink mode is slowed down by toroidal effects to a weak resistive tearing/interchange mode. It is suggested that weak resistive instabilities are stabilized during the ramp phase of the sawteeth by effects not included in linear resistive magnetohydrodynamics. Possible mechanisms for triggering a sawtooth crash are discussed.