1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05: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 95105687f1
commit 5dede89f82

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;