diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2018-06-20 12:36:51 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2018-06-20 12:36:51 -0500 |
commit | 19bf49a710f27d4774ed4c6372d87d6ba15f189e (patch) | |
tree | f76dfea2723295c61437ff453485b09dd6845bf4 | |
parent | 64354831da2adeba5cb2f91a81fa0f56e1ce4ed9 (diff) |
libeinfo: convert remaining snprintf calls to xasprintf
-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 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; } |