mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-12-04 14:46:31 -05:00
honor field width in %s and %H
svn path=/icecast/trunk/log/; revision=18362
This commit is contained in:
parent
ae29f1dca9
commit
56d4ef3557
@ -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)
|
|||||||
}
|
}
|
||||||
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user