From 19bf49a710f27d4774ed4c6372d87d6ba15f189e Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 20 Jun 2018 12:36:51 -0500 Subject: libeinfo: convert remaining snprintf calls to xasprintf --- src/libeinfo/libeinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libeinfo') 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; } -- cgit v1.2.3