summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Brunner <s.brunner@stephan-brunner.net>2022-11-01 10:46:59 +0100
committerStephan Brunner <s.brunner@stephan-brunner.net>2022-11-01 10:46:59 +0100
commitad94c19554d7c6bb18ab2e251e4ee403ee0b7732 (patch)
treed76e2475309edbf7a778aeed2b9af7c1dc1d4567
parent4e86498731a1e31e313e6f60f73344e0506fd29b (diff)
downloadaccel-ppp-ad94c19554d7c6bb18ab2e251e4ee403ee0b7732.tar.gz
accel-ppp-ad94c19554d7c6bb18ab2e251e4ee403ee0b7732.zip
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.
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c2
1 files changed, 1 insertions, 1 deletions
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;
}