- pidfilename = xmalloc(strlen(netname)+20);
- sprintf(pidfilename, "/var/run/tinc.%s.pid", netname);
- confbase = xmalloc(strlen(netname)+8+strlen(CONFDIR));
- sprintf(confbase, "%s/tinc/%s/", CONFDIR, netname);
- identname = xmalloc(strlen(netname)+7);
- sprintf(identname, "tinc.%s", netname);
+ asprintf(&pidfilename, "/var/run/tinc.%s.pid", netname);
+ asprintf(&confbase, "%s/tinc/%s/", CONFDIR, netname);
+ asprintf(&identname, "tinc.%s", netname);