aboutsummaryrefslogtreecommitdiff
path: root/tests/client
diff options
context:
space:
mode:
Diffstat (limited to 'tests/client')
-rw-r--r--tests/client/torture_knownhosts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/client/torture_knownhosts.c b/tests/client/torture_knownhosts.c
index 8f9db8e..ed1f311 100644
--- a/tests/client/torture_knownhosts.c
+++ b/tests/client/torture_knownhosts.c
@@ -47,6 +47,7 @@ static void teardown(void **state) {
static void torture_knownhosts_port(void **state) {
ssh_session session = *state;
char buffer[200];
+ char *p;
FILE *file;
int rc;
@@ -69,7 +70,8 @@ static void torture_knownhosts_port(void **state) {
file = fopen(KNOWNHOSTFILES, "r");
assert_true(file != NULL);
- fgets(buffer, sizeof(buffer), file);
+ p = fgets(buffer, sizeof(buffer), file);
+ assert_false(p == NULL)
fclose(file);
buffer[sizeof(buffer) - 1] = '\0';
assert_true(strstr(buffer,"[localhost]:1234 ") != NULL);