libeinfo: convert remaining snprintf calls to xasprintf

This commit is contained in:
William Hubbs 2018-06-20 12:36:51 -05:00
parent 64354831da
commit 19bf49a710

View File

@ -904,7 +904,7 @@ void eoutdent(void)
{ {
char *env = getenv("EINFO_INDENT"); char *env = getenv("EINFO_INDENT");
int amount = 0; int amount = 0;
char num[10]; char *num = NULL;
int serrno = errno; int serrno = errno;
if (!env) if (!env)
@ -918,8 +918,9 @@ void eoutdent(void)
if (amount <= 0) if (amount <= 0)
unsetenv("EINFO_INDENT"); unsetenv("EINFO_INDENT");
else { else {
snprintf(num, 10, "%08d", amount); xasprintf(&num, "%08d", amount);
setenv("EINFO_INDENT", num, 1); setenv("EINFO_INDENT", num, 1);
free(num);
} }
errno = serrno; errno = serrno;
} }