agent: Replace some sprintf.