aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDomen Puncer <domen@coderock.org>2005-01-10 17:18:29 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-10 17:18:29 -0800
commita28510caf1be629b2c3476ff8e441240e8aae0d5 (patch)
treef2e0bb7aeba86b1f9e067b0f865be13420d5d9c8 /fs
parent7c747c5fc18b13748c635321b25b02dc2ffd0b37 (diff)
downloadhistory-a28510caf1be629b2c3476ff8e441240e8aae0d5.tar.gz
[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: walter harms <wharms@bfs.de> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/proc_tty.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index e4e2f6b5e9c1d6..15c4455b09eb33 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -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));
}