Commit 56d4ef35 authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

honor field width in %s and %H

svn path=/icecast/trunk/log/; revision=18362
parent ae29f1dc
...@@ -516,7 +516,7 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap) ...@@ -516,7 +516,7 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap)
// is branch optimized. // is branch optimized.
if (*format == 'H' ) if (*format == 'H' )
{ {
for (; *arg && block_len && size; arg++, size--) for (; *arg && block_len && size; arg++, size--, block_len--)
{ {
if (*arg <= '"' || *arg == '`' || *arg == '\\') if (*arg <= '"' || *arg == '`' || *arg == '\\')
*(str++) = '.'; *(str++) = '.';
...@@ -526,7 +526,7 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap) ...@@ -526,7 +526,7 @@ static void __vsnprintf(char *str, size_t size, const char *format, va_list ap)
} }
else else
{ {
for (; *arg && block_len && size; arg++, size--) for (; *arg && block_len && size; arg++, size--, block_len--)
*(str++) = *arg; *(str++) = *arg;
} }
in_block = 0; 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