From f73ab8a811bc874c2fb403012aa8e4bfdcaf5ec7 Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Sun, 26 Jan 2020 00:09:50 +0000 Subject: upstream: unbreak unittests for recent API / source file changes OpenBSD-Regress-ID: 075a899a01bbf7781d38bf0b33d8366faaf6d3c0 --- regress/unittests/sshkey/common.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'regress/unittests/sshkey/common.c') diff --git a/regress/unittests/sshkey/common.c b/regress/unittests/sshkey/common.c index e21638093..effea578c 100644 --- a/regress/unittests/sshkey/common.c +++ b/regress/unittests/sshkey/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.3 2018/09/13 09:03:20 djm Exp $ */ +/* $OpenBSD: common.c,v 1.4 2020/01/26 00:09:50 djm Exp $ */ /* * Helpers for key API tests * @@ -43,13 +43,10 @@ struct sshbuf * load_file(const char *name) { - int fd; - struct sshbuf *ret; + struct sshbuf *ret = NULL; - ASSERT_PTR_NE(ret = sshbuf_new(), NULL); - ASSERT_INT_NE(fd = open(test_data_file(name), O_RDONLY), -1); - ASSERT_INT_EQ(sshkey_load_file(fd, ret), 0); - close(fd); + ASSERT_INT_EQ(sshbuf_load_file(test_data_file(name), &ret), 0); + ASSERT_PTR_NE(ret, NULL); return ret; } -- cgit v1.2.3