diff options
| author | David Laight <david.laight.linux@gmail.com> | 2026-03-23 11:22:47 +0000 |
|---|---|---|
| committer | Thomas Weißschuh <linux@weissschuh.net> | 2026-04-01 18:02:37 +0200 |
| commit | 1dff9ac2c85860af67a74777fa6d31c2ad07a15a (patch) | |
| tree | 1001788e66cf14e2255e0aee59f188d2dd8c9484 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 6285f0881ec68034399d13552f7243e69e6e37bf (diff) | |
tools/nolibc/printf: Support negative variable width and precision
For (eg) "%*.*s" treat a negative field width as a request to left align
the output (the same as the '-' flag), and a negative precision to
request the default precision.
Set the default precision to -1 (not INT_MAX) and add explicit checks
to the string handling for negative values (makes the tet unsigned).
For numeric output check for 'precision >= 0' instead of testing
_NOLIBC_PF_FLAGS_CONTAIN(flags, '.').
This needs an inverted test, some extra goto and removes an indentation.
The changed conditionals fix printf("%0-#o", 0) - but '0' and '-' shouldn't
both be specified.
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Link: https://patch.msgid.link/20260323112247.3196-1-david.laight.linux@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
