From 8a945194afb106428bc700e751078ef9944ee617 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Tue, 19 Jun 2018 13:52:40 -0500 Subject: libeinfo: clean up gcc 7 compiler warnings --- 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 198af0f4..5a637ffc 100644 --- a/src/libeinfo/libeinfo.c +++ b/src/libeinfo/libeinfo.c @@ -883,7 +883,7 @@ eindent(void) { char *env = getenv("EINFO_INDENT"); int amount = 0; - char num[10]; + char *num; if (env) { errno = 0; @@ -894,8 +894,9 @@ eindent(void) amount += INDENT_WIDTH; if (amount > INDENT_MAX) amount = INDENT_MAX; - snprintf(num, 10, "%08d", amount); + xasprintf(&num, "%08d", amount); setenv("EINFO_INDENT", num, 1); + free(num); } hidden_def(eindent) -- cgit v1.2.3