aboutsummaryrefslogtreecommitdiff
path: root/src/libeinfo/libeinfo.c
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-19 13:52:40 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-19 13:52:40 -0500
commit8a945194afb106428bc700e751078ef9944ee617 (patch)
tree9fd67d681f09034ab730452b349dfed79ce06cfd /src/libeinfo/libeinfo.c
parentaa4a004c297ec7a1fb794ad2e53ef3ac8b3f4fd1 (diff)
libeinfo: clean up gcc 7 compiler warnings
Diffstat (limited to 'src/libeinfo/libeinfo.c')
-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 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)