Commit 77555afe authored by Philipp Schafft's avatar Philipp Schafft 🦁

honor field width in %s and %H

svn path=/icecast/trunk/log/; revision=18362
parent 9c4bfd0c
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment