aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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;
}