diff options
author | Karel Zak | 2011-09-06 03:18:46 +0200 |
---|---|---|
committer | Karel Zak | 2011-09-06 03:18:46 +0200 |
commit | b89fdd9c05a6e5f12ab56441389e5ee9d1d7f30f (patch) | |
tree | 711ada422560fa21f5da231c12851296519f8bca /term-utils | |
parent | dmesg: remove extra space only after time stamp (diff) | |
download | kernel-qcow2-util-linux-b89fdd9c05a6e5f12ab56441389e5ee9d1d7f30f.tar.gz kernel-qcow2-util-linux-b89fdd9c05a6e5f12ab56441389e5ee9d1d7f30f.tar.xz kernel-qcow2-util-linux-b89fdd9c05a6e5f12ab56441389e5ee9d1d7f30f.zip |
write: fix path for freopen()
Reported-by: xinglp <xinglp@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils')
-rw-r--r-- | term-utils/write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/term-utils/write.c b/term-utils/write.c index a825f6247..a70eb7bd1 100644 --- a/term-utils/write.c +++ b/term-utils/write.c @@ -322,7 +322,7 @@ void do_write(char *tty, char *mytty, uid_t myuid) if (strlen(tty) + 6 > sizeof(path)) errx(EXIT_FAILURE, _("tty path %s too long"), tty); - printf(path, "/dev/%s", tty); + snprintf(path, sizeof(path), "/dev/%s", tty); if ((freopen(path, "w", stdout)) == NULL) err(EXIT_FAILURE, "%s", path); |