use xstrfmt to replace xmalloc + sprintf