Why not just asprintf?