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 D465E138334 for ; Wed, 20 Jun 2018 17:37:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A212DE0909; Wed, 20 Jun 2018 17:37:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 65C96E0909 for ; Wed, 20 Jun 2018 17:37:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 43EFF335CB9 for ; Wed, 20 Jun 2018 17:37:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4FBB72AD for ; Wed, 20 Jun 2018 17:37:40 +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: <1529516211.19bf49a710f27d4774ed4c6372d87d6ba15f189e.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/libeinfo/ X-VCS-Repository: proj/openrc X-VCS-Files: src/libeinfo/libeinfo.c X-VCS-Directories: src/libeinfo/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 19bf49a710f27d4774ed4c6372d87d6ba15f189e X-VCS-Branch: master Date: Wed, 20 Jun 2018 17:37:40 +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: beeb5bd3-b91e-4cd7-a64f-f93b60d6929c X-Archives-Hash: de352fa1f06818a8b761c6101ccc7cc4 commit: 19bf49a710f27d4774ed4c6372d87d6ba15f189e Author: William Hubbs gmail com> AuthorDate: Wed Jun 20 17:36:51 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Jun 20 17:36:51 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=19bf49a7 libeinfo: convert remaining snprintf calls to xasprintf src/libeinfo/libeinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c index 5a637ffc..b8064540 100644 --- a/src/libeinfo/libeinfo.c +++ b/src/libeinfo/libeinfo.c @@ -904,7 +904,7 @@ void eoutdent(void) { char *env = getenv("EINFO_INDENT"); int amount = 0; - char num[10]; + char *num = NULL; int serrno = errno; if (!env) @@ -918,8 +918,9 @@ void eoutdent(void) if (amount <= 0) unsetenv("EINFO_INDENT"); else { - snprintf(num, 10, "%08d", amount); + xasprintf(&num, "%08d", amount); setenv("EINFO_INDENT", num, 1); + free(num); } errno = serrno; }