Make tmpbuffer auto, and make its length the more logical BUFSIZ.