summaryrefslogtreecommitdiff
path: root/src/openvpn/console.c
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-05-10 17:40:25 +0200
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-05-10 17:40:25 +0200
commitffca24bed7a03d95585ad02278667abe75d8b272 (patch)
tree336f336401e5166e1009e24a6c8d40b97a97af89 /src/openvpn/console.c
parent9653b1bffea4e96c1eb7c1814e8bed21fea62321 (diff)
Imported Upstream version 2.3.11upstream/2.3.11
Diffstat (limited to 'src/openvpn/console.c')
-rw-r--r--src/openvpn/console.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/openvpn/console.c b/src/openvpn/console.c
index e1d46c4..86331a1 100644
--- a/src/openvpn/console.c
+++ b/src/openvpn/console.c
@@ -172,8 +172,9 @@ get_console_input_systemd (const char *prompt, const bool echo, char *input, con
if ((std_out = openvpn_popen (&argv, NULL)) < 0) {
return false;
}
- CLEAR (*input);
- if (read (std_out, input, capacity) != 0)
+
+ memset (input, 0, capacity);
+ if (read (std_out, input, capacity-1) > 0)
{
chomp (input);
ret = true;