From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B42DF138334 for ; Tue, 19 Jun 2018 23:00:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B486AE0916; Tue, 19 Jun 2018 23:00:17 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8A5C8E0916 for ; Tue, 19 Jun 2018 23:00:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2D935335C90 for ; Tue, 19 Jun 2018 23:00:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9AEAF2CD for ; Tue, 19 Jun 2018 23:00:04 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1529449030.e14edd765fdc4ed43356d2eef35fa99228e5d461.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/supervise-daemon.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: e14edd765fdc4ed43356d2eef35fa99228e5d461 X-VCS-Branch: master Date: Tue, 19 Jun 2018 23:00:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: eef14cfc-5220-41c2-b02a-7f805cba6e49 X-Archives-Hash: fb0051b629a0bbab6e37e47d5cdb4f17 commit: e14edd765fdc4ed43356d2eef35fa99228e5d461 Author: William Hubbs gmail com> AuthorDate: Tue Jun 19 22:57:10 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Jun 19 22:57:10 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=e14edd76 supervise-daemon: convert snprintf calls to xasprintf src/rc/supervise-daemon.c | 5 +---- 1 file changed, 1 insertion(+), 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; }