1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-06-16 06:15:24 +00:00

honor field width in %s and %H

svn path=/icecast/trunk/log/; revision=18362
This commit is contained in:
Philipp Schafft 2012-06-07 18:13:28 +00:00
parent ae29f1dca9
commit 56d4ef3557

View File

@ -516,7 +516,7 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap)
// is branch optimized.
if (*format == 'H' )
{
for (; *arg && block_len && size; arg++, size--)
for (; *arg && block_len && size; arg++, size--, block_len--)
{
if (*arg <= '"' || *arg == '`' || *arg == '\\')
*(str++) = '.';
@ -526,7 +526,7 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap)
}
else
{
for (; *arg && block_len && size; arg++, size--)
for (; *arg && block_len && size; arg++, size--, block_len--)
*(str++) = *arg;
}
in_block = 0;