vsprintf: deal with format specifiers with a lookup table
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 19 Dec 2024 18:55:56 +0000 (10:55 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 23 Dec 2024 19:18:35 +0000 (11:18 -0800)
commit614d13462daef9bf6ac735744b5835a18cbfd19c
tree655ba6e092ccc9a6b5b09f18010d56979e2516fc
parent312f48b2e27f0f8ede4260e024352fdad225d1c5
vsprintf: deal with format specifiers with a lookup table

We did the flags as an array earlier, they had simpler rules.  The final
format specifiers are a bit more complex since they have more fields to
deal with, and we want to handle the length modifiers at the same time.
But like the flags, we're better off just making it a data-driven table
rather than some case statement.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/vsprintf.c