decruft stream-read-char function