assign_name() in net/net.c is using snprintf + g_strdup to get the same
result as g_strdup_printf.
Signed-off-by: Hani Benhabiles <kroosec@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
static char *assign_name(NetClientState *nc1, const char *model)
{
NetClientState *nc;
- char buf[256];
int id = 0;
QTAILQ_FOREACH(nc, &net_clients, next) {
}
}
- snprintf(buf, sizeof(buf), "%s.%d", model, id);
-
- return g_strdup(buf);
+ return g_strdup_printf("%s.%d", model, id);
}
static void qemu_net_client_destructor(NetClientState *nc)