From 1d9f9f9e64b91daee180e47644bd764821c2f7b7 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 29 Apr 1998 09:42:46 +0000 Subject: [PATCH] (emacs_get_tty): Zero out termios structure before getting attributes to get consistent values for holes. (emacs_set_tty): Likewise. --- src/sysdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sysdep.c b/src/sysdep.c index ea01f3515fc..4fad9bc1ed9 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1069,6 +1069,7 @@ emacs_get_tty (fd, settings) /* Retrieve the primary parameters - baud rate, character size, etcetera. */ #ifdef HAVE_TCATTR /* We have those nifty POSIX tcmumbleattr functions. */ + bzero (&settings->main, sizeof (settings->main)); if (tcgetattr (fd, &settings->main) < 0) return -1; @@ -1147,6 +1148,7 @@ emacs_set_tty (fd, settings, flushp) { struct termios new; + bzero (&new, sizeof (new)); /* Get the current settings, and see if they're what we asked for. */ tcgetattr (fd, &new); /* We cannot use memcmp on the whole structure here because under -- 2.39.2