diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-07-23 09:33:08 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-07-23 09:33:08 +0000 |
commit | 5521539314d87d3432e3c5c0e74954a673a884bd (patch) | |
tree | 8f06d9ad2f958f06e579924065ecbaf74dd734f7 /ttymodes.c | |
parent | d4033b6b6f7aa0e69be09f9613e062e0fb7a9f11 (diff) | |
download | src-5521539314d87d3432e3c5c0e74954a673a884bd.tar.gz src-5521539314d87d3432e3c5c0e74954a673a884bd.zip |
Vendor import of OpenSSH 5.1p1
Notes
Notes:
svn path=/vendor-crypto/openssh/dist/; revision=180750
Diffstat (limited to 'ttymodes.c')
-rw-r--r-- | ttymodes.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ttymodes.c b/ttymodes.c index d8e2c553abd6..e116b1999069 100644 --- a/ttymodes.c +++ b/ttymodes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttymodes.c,v 1.26 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: ttymodes.c,v 1.28 2008/07/07 00:31:41 stevesk Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -298,6 +298,10 @@ tty_make_modes(int fd, struct termios *tiop) } if (tiop == NULL) { + if (fd == -1) { + debug("tty_make_modes: no fd or tio"); + goto end; + } if (tcgetattr(fd, &tio) == -1) { logit("tcgetattr: %.100s", strerror(errno)); goto end; @@ -317,12 +321,10 @@ tty_make_modes(int fd, struct termios *tiop) /* Store values of mode flags. */ #define TTYCHAR(NAME, OP) \ - debug3("tty_make_modes: %d %d", OP, tio.c_cc[NAME]); \ buffer_put_char(&buf, OP); \ put_arg(&buf, special_char_encode(tio.c_cc[NAME])); #define TTYMODE(NAME, FIELD, OP) \ - debug3("tty_make_modes: %d %d", OP, ((tio.FIELD & NAME) != 0)); \ buffer_put_char(&buf, OP); \ put_arg(&buf, ((tio.FIELD & NAME) != 0)); @@ -353,7 +355,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr) int n_bytes = 0; int failure = 0; u_int (*get_arg)(void); - int arg, arg_size; + int arg_size; if (compat20) { *n_bytes_ptr = packet_get_int(); @@ -410,16 +412,14 @@ tty_parse_modes(int fd, int *n_bytes_ptr) case OP: \ n_bytes += arg_size; \ tio.c_cc[NAME] = special_char_decode(get_arg()); \ - debug3("tty_parse_modes: %d %d", OP, tio.c_cc[NAME]); \ break; #define TTYMODE(NAME, FIELD, OP) \ case OP: \ n_bytes += arg_size; \ - if ((arg = get_arg())) \ + if (get_arg()) \ tio.FIELD |= NAME; \ else \ tio.FIELD &= ~NAME; \ - debug3("tty_parse_modes: %d %d", OP, arg); \ break; #include "ttymodes.h" |