Removing unnecessary printf and a typo on the buffersize calculation