aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/examples_common.h4
-rw-r--r--examples/sshnetcat.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/examples/examples_common.h b/examples/examples_common.h
index 13eb455c..d3f4e1aa 100644
--- a/examples/examples_common.h
+++ b/examples/examples_common.h
@@ -14,6 +14,10 @@ clients must be made or how a client should react.
#define EXAMPLES_COMMON_H_
#include <libssh/libssh.h>
+
+/** Zero a structure */
+#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
+
int authenticate_console(ssh_session session);
int authenticate_kbdint(ssh_session session, const char *password);
int verify_knownhost(ssh_session session);
diff --git a/examples/sshnetcat.c b/examples/sshnetcat.c
index 28fb2765..ccc72c86 100644
--- a/examples/sshnetcat.c
+++ b/examples/sshnetcat.c
@@ -90,6 +90,7 @@ static void select_loop(ssh_session session,ssh_channel channel){
do{
int fd;
+ ZERO_STRUCT(fds);
FD_ZERO(&fds);
if(!eof)
FD_SET(0,&fds);