]> asedeno.scripts.mit.edu Git - linux.git/commit
genheaders: %-<width>s had been there since v6; %-*s - since v7
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 10 Dec 2018 08:40:11 +0000 (03:40 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 10 Dec 2018 08:40:11 +0000 (03:40 -0500)
commita40612ef0ee1e524aafee58d0e5713cf5fdb3d62
treed91ab06356cb2ffa1b49320127ed35a948c33d98
parent651022382c7f8da46cb4872a545ee1da6d097d2a
genheaders: %-<width>s had been there since v6; %-*s - since v7

Please, use at least K&R C; printf had been able to left-adjust
a field for as long as stdio existed and use of '*' for variable
width had been there since v7.  Yes, the first edition of K&R
didn't cover the latter feature (it slightly predates v7), but
you are using a much later feature of the language than that -
in K&R C
static char *stoupperx(const char *s)
{
...
}
would've been spelled as
static char *stoupperx(s)
char *s;
{
...
}

While we are at it, the use of strstr() is bogus - it finds the
_first_ instance of substring, so it's a lousy fit for checking
if a string ends with given suffix...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
scripts/selinux/genheaders/genheaders.c