summaryrefslogtreecommitdiff
path: root/src/openvpn/console.c
diff options
context:
space:
mode:
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;