aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-19 17:57:10 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-19 17:57:10 -0500
commite14edd765fdc4ed43356d2eef35fa99228e5d461 (patch)
treee812dadf03c8db3102537420ab2d66c6168e894a
parentf9d41243d8499c5d7027177d5aa716d5b5859cd6 (diff)
supervise-daemon: convert snprintf calls to xasprintf
-rw-r--r--src/rc/supervise-daemon.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 952c610b..60bd1f20 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -186,7 +186,6 @@ static void handle_signal(int sig)
static char * expand_home(const char *home, const char *path)
{
char *opath, *ppath, *p, *nh;
- size_t len;
struct passwd *pw;
if (!path || *path != '~')
@@ -217,9 +216,7 @@ static char * expand_home(const char *home, const char *path)
return xstrdup(home);
}
- len = strlen(ppath) + strlen(home) + 1;
- nh = xmalloc(len);
- snprintf(nh, len, "%s%s", home, ppath);
+ xasprintf(&nh, "%s%s", home, ppath);
free(opath);
return nh;
}