Use facilities from pkg_printf(3) instead of reinventing wheel