Richard Matheson said this quote

But now, in the final hours, even hope had vanished. Yet he could smile. At a point without hope he had found contentment. He knew he had tried and there was nothing to be sorry for. And this was complete victory, because it was a victory over himself.