Thread (11 messages) 11 messages, 6 authors, 2013-09-30

Re: [PATCH 1/2] remove all uses of printf's %n

From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date: 2013-09-21 00:29:40
Also in: linux-sctp, lkml

Kees Cook wrote:
quoted
quoted
-                     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...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help