manage maxbuffer in printf and puts