Fix an incorrect estimation of the sprintf result size.