diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2018-06-19 13:52:40 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2018-06-19 13:52:40 -0500 |
commit | 8a945194afb106428bc700e751078ef9944ee617 (patch) | |
tree | 9fd67d681f09034ab730452b349dfed79ce06cfd /src | |
parent | aa4a004c297ec7a1fb794ad2e53ef3ac8b3f4fd1 (diff) |
libeinfo: clean up gcc 7 compiler warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/libeinfo/libeinfo.c | 5 |
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) |