From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: src/libeinfo/
Date: Wed, 20 Jun 2018 17:37:40 +0000 (UTC) [thread overview]
Message-ID: <1529516211.19bf49a710f27d4774ed4c6372d87d6ba15f189e.williamh@OpenRC> (raw)
commit: 19bf49a710f27d4774ed4c6372d87d6ba15f189e
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Wed Jun 20 17:36:51 2018 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> 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;
}
next reply other threads:[~2018-06-20 17:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 17:37 William Hubbs [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-06-19 21:34 [gentoo-commits] proj/openrc:master commit in: src/libeinfo/ William Hubbs
2016-07-13 22:15 William Hubbs
2013-01-04 14:51 William Hubbs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1529516211.19bf49a710f27d4774ed4c6372d87d6ba15f189e.williamh@OpenRC \
--to=williamh@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox