Fix gcc warnings on openbsd

Hi Michael,

This should ensure the use of snprintf instead of sprintf.

Regards,