From ad94c19554d7c6bb18ab2e251e4ee403ee0b7732 Mon Sep 17 00:00:00 2001 From: Stephan Brunner Date: Tue, 1 Nov 2022 10:46:59 +0100 Subject: Remove uninitialized argument from openpty() As per the docs: The openpty() function finds an available pseudoterminal and returns file descriptors for the master and slave in amaster and aslave. [...] If termp is not NULL, the terminal parameters of the slave will be set to the values in termp. [...] So openpty() would set the pty parameters to something undefined. This undefinedness will be fixed by the later tcsetattr() call. As a result, we don't need that parameter in the first place. Additionally, fixes a -Wmaybe-uninitialized warning. --- accel-pppd/ctrl/sstp/sstp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 40c6ad9..1747057 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -978,7 +978,7 @@ static int ppp_allocate_pty(int *master, int *slave, int flags) struct termios tios; int value, mfd, sfd; - if (openpty(&mfd, &sfd, NULL, &tios, NULL) < 0) { + if (openpty(&mfd, &sfd, NULL, NULL, NULL) < 0) { log_ppp_error("sstp: allocate pty: %s\n", strerror(errno)); return -1; } -- cgit v1.2.3