Other places in mcon its just hardcoded to 255 rather then doing any guesstimations.

The only other solution I can think of is asprintf() ?