Messages in this thread | | | Date | Sun, 22 Sep 2013 10:16:36 +0200 | Subject | Re: [PATCH 1/2] remove all uses of printf's %n | From | Geert Uytterhoeven <> |
| |
On Sat, Sep 21, 2013 at 2:28 AM, Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> wrote: > Kees Cook wrote: >> >> - seq_printf(seq, "%*s\n", 127 - len, ""); >> >> + seq_pad(seq, '\n'); >> > >> > Hmm, seq_pad is unintuitive. I would say it pads the string by '\n'. Of >> > course it does not, but... >> >> I don't think this is a very serious problem. Currently, the padding >> character is always ' ' for all existing callers, so it only makes >> sense to make the trailing character an argument. > > If you want, we can rename seq_pad() to seq_pad_and_putc(). Also we can pass > both the padding character (e.g. ' ') and the trailing character (e.g. '\n') > like seq_pad_and_putc((' ' << 8) | '\n'), though I wonder someone wants to > use '\0', '\t', '\n' etc. as the padding character...
Not those special characters. '-' could be useful for tables (doh, text-mode graphics log output).
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
| |