mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-05-30 05:24:50 +03:00
tests: Check return value of stat.
This commit is contained in:
parent
485e3b4014
commit
68be73ec0d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user