03.05.2017 13:44, Paolo Bonzini wrote:
> Detected by GCC 7's -Wformat-truncation. snprintf writes at most
> 2 bytes here including the terminating NUL, so the result is
> truncated. In addition, the newline at the end is pointless.
> Fix the buffer size and the format string.
Applied to -trivial
On 05/05/2017 08:24, Michael Tokarev wrote:
> 03.05.2017 13:44, Paolo Bonzini wrote:
>> Detected by GCC 7's -Wformat-truncation. snprintf writes at most
>> 2 bytes here including the terminating NUL, so the result is
>> truncated. In addition, the newline at the end is pointless.
>> Fix the buf
03.05.2017 13:44, Paolo Bonzini wrote:
> Detected by GCC 7's -Wformat-truncation. snprintf writes at most
> 2 bytes here including the terminating NUL, so the result is
> truncated. In addition, the newline at the end is pointless.
> Fix the buffer size and the format string.
Polo, that's quite
Paolo Bonzini writes:
> On 03/05/2017 14:56, Markus Armbruster wrote:
>>> snprintf writes at most 2 bytes here including the terminating NUL, so
>>> the result is truncated".
>>
>> You're right; I forgot that snprintf() always adds a NUL. So this *is*
>> broken: we write NUL instead of the secon
On 03/05/2017 14:56, Markus Armbruster wrote:
>> snprintf writes at most 2 bytes here including the terminating NUL, so
>> the result is truncated".
>
> You're right; I forgot that snprintf() always adds a NUL. So this *is*
> broken: we write NUL instead of the second digit. Mentioning this in
Paolo Bonzini writes:
> On 03/05/2017 13:38, Markus Armbruster wrote:
>> Paolo Bonzini writes:
>>
>>> Detected by GCC 7's -Wformat-truncation. snprintf writes at most
>>> 2 bytes here including the terminating NUL, so the result is
>>> truncated. In addition, the newline at the end is pointle
On 03/05/2017 13:38, Markus Armbruster wrote:
> Paolo Bonzini writes:
>
>> Detected by GCC 7's -Wformat-truncation. snprintf writes at most
>> 2 bytes here including the terminating NUL, so the result is
>> truncated. In addition, the newline at the end is pointless.
>> Fix the buffer size an
Paolo Bonzini writes:
> Detected by GCC 7's -Wformat-truncation. snprintf writes at most
> 2 bytes here including the terminating NUL, so the result is
> truncated. In addition, the newline at the end is pointless.
> Fix the buffer size and the format string.
> ---
> hw/display/jazz_led.c | 4
Detected by GCC 7's -Wformat-truncation. snprintf writes at most
2 bytes here including the terminating NUL, so the result is
truncated. In addition, the newline at the end is pointless.
Fix the buffer size and the format string.
---
hw/display/jazz_led.c | 4 ++--
1 file changed, 2 insertions(+