[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: fix OSX build errors when enabling tests
[Thread Prev] | [Thread Next]
[Date Prev] | [Date Next]
- Subject: [PATCH] tests: fix OSX build errors when enabling tests
- From: Alberto Aguirre <albaguirre@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Fri, 2 Mar 2018 12:56:47 -0600
- To: libssh@xxxxxxxxxx
- Cc: Alberto Aguirre <albaguirre@xxxxxxxxx>
Fix OSX build error about embedding a directive within macro arguments.
Apparently, snprintf is implemented as a macro on that platform.
Signed-off-by: Alberto Aguirre <albaguirre@xxxxxxxxx>
---
tests/torture.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tests/torture.c b/tests/torture.c
index e442b8db..48a70d65 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -681,16 +681,24 @@ static void torture_setup_create_sshd_config(void **state)
}
assert_non_null(sftp_server);
+#ifdef HAVE_DSA
snprintf(sshd_config, sizeof(sshd_config),
config_string,
-#ifdef HAVE_DSA
dsa_hostkey,
-#endif
rsa_hostkey,
ecdsa_hostkey,
trusted_ca_pubkey,
sftp_server,
s->srv_pidfile);
+#else
+ snprintf(sshd_config, sizeof(sshd_config),
+ config_string,
+ rsa_hostkey,
+ ecdsa_hostkey,
+ trusted_ca_pubkey,
+ sftp_server,
+ s->srv_pidfile);
+#endif
torture_write_file(s->srv_config, sshd_config);
}
--
2.14.1
Archive administrator: postmaster@lists.cynapses.org