summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-06-18 17:11:34 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-06-18 17:11:34 +0200
commit68be73ec0d7ed6defd6dc212cd702b4913c51175 (patch)
tree655171c4d7a7b8bb02fba7164e9cbd239a6e58fb /tests
parent485e3b4014f9b04bd4b055abfba07b651ebb1767 (diff)
downloadlibssh-68be73ec0d7ed6defd6dc212cd702b4913c51175.tar.gz
libssh-68be73ec0d7ed6defd6dc212cd702b4913c51175.tar.xz
libssh-68be73ec0d7ed6defd6dc212cd702b4913c51175.zip
tests: Check return value of stat.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/torture_pki.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unittests/torture_pki.c b/tests/unittests/torture_pki.c
index 31618a4..20bf5c6 100644
--- a/tests/unittests/torture_pki.c
+++ b/tests/unittests/torture_pki.c
@@ -85,12 +85,14 @@ static char *read_file(const char *filename) {
char *key;
int fd;
int size;
+ int rc;
struct stat buf;
assert_true(filename != NULL);
assert_true(*filename != '\0');
- stat(filename, &buf);
+ rc = stat(filename, &buf);
+ assert_int_equal(rc, 0);
key = malloc(buf.st_size + 1);
assert_true(key != NULL);