aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-20 12:36:51 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-20 12:36:51 -0500
commit19bf49a710f27d4774ed4c6372d87d6ba15f189e (patch)
treef76dfea2723295c61437ff453485b09dd6845bf4
parent64354831da2adeba5cb2f91a81fa0f56e1ce4ed9 (diff)
libeinfo: convert remaining snprintf calls to xasprintf
-rw-r--r--src/libeinfo/libeinfo.c5
1 files 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;
}