A stable scheme for the one-dimensional diffusion equation