Skip to content

Commit

Permalink
tomoyo: fix sparse warning
Browse files Browse the repository at this point in the history
Fix sparse warning.

$ make C=2 SUBDIRS=security/tomoyo CF="-D__cold__="
 CHECK   security/tomoyo/common.c
 CHECK   security/tomoyo/realpath.c
 CHECK   security/tomoyo/tomoyo.c
security/tomoyo/tomoyo.c:110:8: warning: symbol 'buf' shadows an earlier one
security/tomoyo/tomoyo.c:100:7: originally declared here

Signed-off-by: Kentaro Takeda <takedakn@nttdata.co.jp>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Toshiharu Harada <haradats@nttdata.co.jp>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Tetsuo Handa authored and James Morris committed Feb 12, 2009
1 parent 42d5aaa commit 35d50e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions security/tomoyo/tomoyo.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ static char *tomoyo_sysctl_path(struct ctl_table *table)
*--end = '\0';
buflen--;
while (table) {
char buf[32];
char num[32];
const char *sp = table->procname;

if (!sp) {
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf) - 1, "=%d=", table->ctl_name);
sp = buf;
memset(num, 0, sizeof(num));
snprintf(num, sizeof(num) - 1, "=%d=", table->ctl_name);
sp = num;
}
if (tomoyo_prepend(&end, &buflen, sp) ||
tomoyo_prepend(&end, &buflen, "/"))
Expand Down

0 comments on commit 35d50e6

Please sign in to comment.