Commit a28510ca authored by Domen Puncer's avatar Domen Puncer Committed by Linus Torvalds

[PATCH] fs/proc/proc_tty.c: avoid array

No need for an array here.  Therefore no need to worry about possible
overflows.  seq_printf() can handle this.
Signed-off-by: default avatarwalter harms <wharms@bfs.de>
Signed-off-by: default avatarDomen Puncer <domen@coderock.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7c747c5f
......@@ -32,10 +32,8 @@ static void show_tty_range(struct seq_file *m, struct tty_driver *p,
seq_printf(m, "%-20s ", p->driver_name ? p->driver_name : "unknown");
seq_printf(m, "/dev/%-8s ", p->name);
if (p->num > 1) {
char range[20];
sprintf(range, "%d-%d", MINOR(from),
seq_printf(m, "%3d %d-%d ", MAJOR(from), MINOR(from),
MINOR(from) + num - 1);
seq_printf(m, "%3d %7s ", MAJOR(from), range);
} else {
seq_printf(m, "%3d %7d ", MAJOR(from), MINOR(from));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment