Implement printf() for buffers