Paolo Bonzini <pbonz...@redhat.com> 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 second digit. Mentioning this in >> the commit message wouldn't hurt. > > Well, it does, see the quote. :)
Yes, snprintf() truncates, but that's *internal* to jazz_led_text_update(). The *external* effect isn't quite truncation, it's writing NUL to the console instead of the second digit. That's truncation only if the console ignores NUL. It might; I don't know. Anyway, no big deal.