Messages in this thread | | | Date | 17 Sep 2013 16:57:42 -0400 | From | "George Spelvin" <> | Subject | Re: [PATCH 1/2] remove all uses of printf's %n |
| |
>> seq_setwidth(m, 21); >> seq_printf(m, "%s%d", con->name, con->index); >> seq_pad(m, '\n');
> Ooh, I like this a lot! Much cleaner.
That's certainly a good way to do it, too. My "general principles" filter thinks it should be in a local variable if it can, but if hiding it in the struct seq_file is fine if people find that cleaner.
seq_pad could also reset the field to some null value and warn if it's found in that state. Not a strong preference, though; the error is fairly harmless and you might not feel it's worth the code size.
| |