aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test_akfs.c
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-04 03:39:36 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-04 03:39:36 +0300
commitf8eb78b14cb12b8e8842276c03130694675bdc1e (patch)
treec3ba2361e1cad140e8cb845a7c404d2cfc083c0c /src/tests/test_akfs.c
parent40206d2ede1c9963c4e4f718e1e203e5d901af73 (diff)
downloadarching-kaos-tools-f8eb78b14cb12b8e8842276c03130694675bdc1e.tar.gz
arching-kaos-tools-f8eb78b14cb12b8e8842276c03130694675bdc1e.tar.bz2
arching-kaos-tools-f8eb78b14cb12b8e8842276c03130694675bdc1e.zip
Forgot to exit in case of fopen error and check also on the second call
Diffstat (limited to 'src/tests/test_akfs.c')
-rw-r--r--src/tests/test_akfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/test_akfs.c b/src/tests/test_akfs.c
index e95508b..c1eddbc 100644
--- a/src/tests/test_akfs.c
+++ b/src/tests/test_akfs.c
@@ -152,12 +152,18 @@ void hash_save_to_file()
if ( fd == NULL )
{
printf("Some error occured");
+ exit(1);
}
fwrite(&resulted_hash, sizeof(sha512sum),1,fd);
fclose(fd);
sha512sum readone = {0};
fd = fopen("tmpfile", "rb");
+ if ( fd == NULL )
+ {
+ printf("Some error occured");
+ exit(1);
+ }
fread (&readone, sizeof(sha512sum),1,fd);
char* resulted_string = ak_fs_sha512sum_struct_to_string(readone);